FindControl for Gridview for a row being edited..
Posted on 2010-11-29
I have been trying.. But not much success
I have a datagrid view where I have made the columns templates. So I have a textbox that I want to read when I select edit, in order to get the origial field as the field I am changing is a key field.. So I can not use the edit logic. When they choose update I need to know the original value in order to delete the record.. And then the new value in order to add the value..
I have tried at the gridview_SelectedIndexChange using
GridViewRow row = gvDistributionList.Rows[e.NewSelectedIndex];
For some reason this event doesn't trigger, or does not trigger befor the RowEditing Event.
At rowEditing Event I have tried the following:
GridViewRow row = gvDistributionList.Rows[e.NewEditIndex];
The field remains null..
So how can I figure out and set programically the row I am working with when the Edit is triggered..