This documentation is archived and is not being maintained.

GridViewUpdateEventArgs::OldValues Property

Gets a dictionary containing the original field name/value pairs in the row to update.

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

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

Property Value

Type: System.Collections.Specialized::IOrderedDictionary
An System.Collections.Specialized::IOrderedDictionary object that contains the original values of the field name/value pairs in the row to update.

Use the OldValues property (dictionary) to access the original values of the fields in the row to update. This dictionary contains all fields in the row except the key fields. The key fields are defined in the DataKeyNames property of a GridView control.

NoteNote:

You can access the key fields of the row by using the Keys property. To access the revised values of the non-key fields in the row, use the NewValues property.

The OldValues property is automatically populated with the original values of all the field name/value pairs in the row. A separate entry is added to the OldValues property for each field in the row.

To determine the field name of an entry, use the DictionaryEntry::Key property of a System.Collections::DictionaryEntry object contained in the OldValues dictionary. To determine the value of an entry, use the DictionaryEntry::Value property.

The following example demonstrates how to use the OldValues property to access the original values of the fields in the row to update. The values are then written to a log file of updated records.

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: