JimHugh wrote:
"RowEnter: Occurs when a row receives input focus and becomes the current row."
This doesn't occur during databinding, but during navigation of the grid.
You may also want to look into the DoubleClick, CellClick or ContentClick events.
What I believe you are looking for is the OnSelectedIndexChanged event. In here you can retrieve the currently selected rows key value.
IN the gridview definition, specify a column for selecting a row like this:
<asp:ButtonField Text="Select..."
HeaderText="Select"
CommandName="Select"/>
clicking on this link in the grid calls the "OnSelectedIndexChanged" event which you hook up with this code in the gridview definition:
OnSelectedIndexChanged="App_LookUpTables_GridView_OnSelectedIndexChanged"
DataKeyNames="LuTableID" ---> specifies what field is the pk field.
in the above specified method, you can retrieve the key value like this:
[gridname].SelectedDataKey.Value.ToString();
Hope this helps!
Harold