utorak, 25. kolovoza 2009.

How to get DataKey of GridView?

Once you have specified DataKeyNames, you can retrieve the datakey for the
selected row by simply using - GridView1.SelectedValue

Example:

string selValue = GridView1.SelectedValue.ToString();