title: ASP.Net: Getting DataKey from GridView on Edit and Delete
body: <p>I am using a <code>GridView</code> control which is databound to a <code>List</code> of objects returned from a utility method. The <code>GridView</code> control has one of the columns set as its DataKey. When a row is <code>Selected</code>, it fires the Selected event handler and I can use <code>myGridView.SelectedDataKey.Value</code> to get the value of the DataKey column for the selected row.</p>
  
  <p>However, the event handler for when a row is <code>Edited</code> or <code>Deleted</code> does not seem to have a mechanism to get the DataKey value for the row in question. The event arg parameter for these event handlers contains the index of the row in the <code>GridView</code> but I'm specifically after the DataKey value.</p>
  
  <p>Re-obtaining the List of objects via the utility method along with the index obtained from the event arg parameter is not an option because the List of objects may have changed.</p>
  
  <p>Can anyone tell me how I can do this?</p>
  
  <p>TIA</p>