Last post Mar 15, 2017 02:21 PM by mgebhard
Mar 15, 2017 02:06 PM|funluckykitty|LINK
I'm trying to utilize inline editing of a gridview and am having problems during the RowUpdating event in my code behind. My gridview has a datakey name for the EmployeeID, and I'm able to find that value from the grid just fine. BUT, when I try to find
the value entered in the text box named "FName" in the grid, I'm just not having any luck. How can I find the text entered in a textbox inside my gridview of a specific row? The textbox control is named FName (for first name).
protected void gvEmployee_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
sqlComm.CommandType = CommandType.StoredProcedure;
sqlComm.CommandText = "123";
Mar 15, 2017 02:20 PM|kaushalparik27|LINK
sqlComm.Parameters.AddWithValue("FName", (GridView1.Rows[e.RowIndex].FindControl("FName") as TextBox).Text);
Mar 15, 2017 02:21 PM|mgebhard|LINK
Please see the GridView.RowUpdating Event in the MSDN documentation.
the documentation has example code that shows how to access controls within a GridView.