Hi,
I am trying to retrieve the value from gridview cell in rowediting event.It taking system.web.ui.control.Textbox.
<asp:GridView ID="gdpopulate" runat="server" AutoGenerateEditButton="True" DataKeyNames="P_Id" OnRowEditing="gdpopulate_RowEditing" AutoGenerateColumns="False" OnRowUpdating="gdpopulate_RowUpdating" OnRowUpdated="gdpopulate_RowUpdated" >
<Columns>
<asp:BoundField DataField="P_Id" HeaderText="PID" ReadOnly="True" />
<asp:TemplateField HeaderText="Firstname">
<ItemTemplate >
<%# Eval("Firstname")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtfname" runat="Server" Text='<%# Eval("Firstname") %>' Columns="30" ></asp:TextBox>
<asp:RequiredFieldValidator ID="req1" runat="Server" Text="*" ControlToValidate="txtfname"></asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
C# code
GridViewRow var = (GridViewRow)gdpopulate.Rows[e.RowIndex];
int pid =Int32.Parse (gdpopulate.DataKeys[e.RowIndex].Value.ToString());
TextBox tfname = (TextBox)gdpopulate.Rows[e.RowIndex].FindControl("txtfname") ;
//TextBox tfname = (TextBox)var.FindControl("txtfname");
help me as soon as possible