assign columns value on rowdatabound in gridview
<p>I am facing a problem in grid view, basically what i am trying to achieve is below:
I have a grid view in which my first column is a link button, i have to put a condition where value from my 2nd column is taken and is input to a c# method for poulating a value which i need to assign into my first column.</p>

<p>I am trying below code however when i view my grid its showing 1st columns value as blank.
Aspx page:</p>

<pre><code>&lt;asp:TemplateField HeaderText="FileName" ItemStyle-HorizontalAlign="Center"&gt; 
&lt;ItemTemplate&gt;
&lt;asp:LinkButton ID="btn"  runat="server" CommandName="Click"/&gt;
&lt;/ItemTemplate&gt; 
&lt;/asp:TemplateField&gt;
</code></pre>

<p>aspx.cs</p>

<pre><code>if (e.Row.RowType == DataControlRowType.DataRow)
{
int EmpiD = Int32.Parse(e.Row.Cells[2].Text);
DataSet EmpIDDs = GetEMP.getValue(EmpiD);
DataRow EmpRow = EmpIDDs.Tables[0].Rows[0];
e.Row.Cells[0].Text = EmpRow[3].ToString();
}
</code></pre>

<p>Please help me if you have any solution</p>
