Gets the System.Web.UI.WebControls.DataKey object that contains the data key value for the selected row in a System.Web.UI.WebControls.GridView control.
Documentation for this section has not yet been entered.
When the GridView.DataKeyNames property is set, the System.Web.UI.WebControls.GridView control automatically creates a System.Web.UI.WebControls.DataKey object for each row in the control using the value or values of the specified field or fields. The System.Web.UI.WebControls.DataKey objects are then added to the control's GridView.DataKeys collection. Normally, the GridView.DataKeys property is used to retrieve the System.Web.UI.WebControls.DataKey object for a specific data row in the System.Web.UI.WebControls.GridView control. However, if you just need to retrieve the System.Web.UI.WebControls.DataKey object of the currently selected row, you can simply use the GridView.SelectedDataKey property as a shortcut.
This is the same as retrieving the System.Web.UI.WebControls.DataKey object at the index specified by the GridView.SelectedIndex property from the GridView.DataKeys collection. You can also use the GridView.SelectedValue property to retrieve the data key value for the currently selected row directly.
If you are creating a System.Web.UI.WebControls.ControlParameter object and want to access a key field other than the first field, use the indexed GridView.SelectedDataKey property in the ControlParameter.PropertyName property of the System.Web.UI.WebControls.ControlParameter object. An example is shown below.