I am using a GridView
control that is bound to List
objects returned from a utility method. The GridView
control has one of the columns defined as a DataKey. When the row is Selected
, it fires the handler of the selected event, and I can use myGridView.SelectedDataKey.Value
to get the value of the DataKey column for the selected row.
However, the event handler when the Edited
or Deleted
line does not seem to have a mechanism to get the DataKey value for the line in question. The arg event parameter for these event handlers contains the row index in the GridView
, but I specifically after the DataKey value.
Retrieving the list of objects using the utility method together with the index obtained from the arg parameter of the event argument is not an option, since the list of objects can be changed.
Can someone tell me how can I do this?
TIA
source share