I have a GridView with an edit button. When the user clicks 'Edit', I want to display the information in a form and allow the user to edit the information. I have a RowCommand event in which I take the data from the row and update form controls. How do I know in the RowCommand what the current row is? I tried GridView.Rows[EditIndex] but I get a -1 when I do that. ex. DateOccured.Text = TimeSheetGridView.Rows[TimeSheetGridView.EditIndex].Cells(4).Text; Bill
Hi, See if this helps: http://www.c-sharpcorner.com/Blogs/BlogDetail.aspx?BlogId=231 "Bill Gower" wrote: > I have a GridView with an edit button. When the user clicks 'Edit', I want > to display the information in a form and allow the user to edit the > information. I have a RowCommand event in which I take the data from the > row and update form controls. How do I know in the RowCommand what the > current row is? I tried GridView.Rows[EditIndex] but I get a -1 when I do > that. > > ex. > > DateOccured.Text = > TimeSheetGridView.Rows[TimeSheetGridView.EditIndex].Cells(4).Text; > > Bill > > >