System.Web.UI.WebControls.FormView.DataKeyNames Property

Gets or sets an array that contains the names of the key fields for the data source.

Syntax

[System.ComponentModel.Editor("System.Web.UI.Design.WebControls.DataFieldEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.StringArrayConverter))]
[System.ComponentModel.DefaultValue(null)]
public virtual string[] DataKeyNames { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the FormView.DataKeyNames property to specify a comma-separated list of field names that represent the primary key of the data source. When the FormView.DataKeyNames property is set, the System.Web.UI.WebControls.FormView control automatically creates a System.Web.UI.WebControls.DataKey object that contains the key/value pairs of the field or fields listed in the FormView.DataKeyNames property for the current record. The System.Web.UI.WebControls.DataKey object is then stored in the FormView.DataKey property.

Note:

You must set the FormView.DataKeyNames property for the built-in updating, deleting, and inserting features of the System.Web.UI.WebControls.FormView control to work.

Requirements

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