System.Web.UI.WebControls.GridViewUpdateEventArgs.Keys Property

Gets a dictionary of field name/value pairs that represent the primary key of the row to update.

Syntax

public System.Collections.Specialized.IOrderedDictionary Keys { get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the GridView.DataKeyNames property of a System.Web.UI.WebControls.GridView control is set, use the GridViewUpdateEventArgs.Keys property (dictionary) to access the value of the primary key in the row to update.

Note:

To access the values of the non-key fields, use the GridViewUpdateEventArgs.NewValues or GridViewUpdateEventArgs.OldValues properties. The GridViewUpdateEventArgs.NewValues property contains the updated values, while the GridViewUpdateEventArgs.OldValues property contains the original values.

The GridViewUpdateEventArgs.Keys dictionary is automatically populated with the name/value pairs of the field or fields specified in the GridView.DataKeyNames property. If multiple fields form the primary key, a separate entry is added to the GridViewUpdateEventArgs.Keys dictionary for each key field.

To determine the name of a key field, use the DictionaryEntry.Key property of a DictionaryEntry object contained in the GridViewUpdateEventArgs.Keys dictionary. To determine the value of a key field, use the DictionaryEntry.Value property.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0