Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GridViewDeleteEventArgs::Keys Property

 

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

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property IOrderedDictionary^ Keys {
	IOrderedDictionary^ get();
}

Property Value

Type: System.Collections.Specialized::IOrderedDictionary^

A dictionary that contains field name/value pairs that represent the primary key of the row to delete.

When the DataKeyNames property of a GridView control is set, use the Keys property (dictionary) to get the value of the primary key or keys of the row to delete.

System_CAPS_noteNote

To get the values of the non-key fields, use the Values property.

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

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

The following example shows how to use the Values property to get the values of the key fields for the row to delete. The values are then written to a log file of deleted records.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft