Gets or sets an array that contains the names of the key fields for the data source.
Assembly: System.Web (in System.Web.dll)
[<TypeConverterAttribute(typeof(StringArrayConverter))>] abstract DataKeyNames : string with get, set [<TypeConverterAttribute(typeof(StringArrayConverter))>] override DataKeyNames : string with get, set
Property ValueType: System.String
An array that contains the names of the key fields of the data source.
Use the property to specify a comma-separated list of field names that represent the primary key of the data source. When the property is set, the DetailsView control automatically creates a DataKey object that represents the key field or fields for the current record and stores it in the DataKey property. When the AutoGenerateColumns property is also set to true, the DetailsView control automatically ensures that the field or fields specified in the property are read-only.
You must set the property for the automatic updating, deleting, and inserting features of the DetailsView control to work.
If the Visible property of a row field is set to false, the row is not displayed in the DetailsView control and the data for the row does not make a round trip to the client. If you want the data for a row that is not visible to make a round trip, add the field name to the property.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.