System.Web.UI.WebControls.DataGrid.EditItemIndex Property

Gets or sets the index of an item in the System.Web.UI.WebControls.DataGrid control to edit.

Syntax

[System.ComponentModel.DefaultValue(-1)]
public virtual int EditItemIndex { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the DataGrid.EditItemIndex property when the System.Web.UI.WebControls.DataGrid control contains an System.Web.UI.WebControls.EditCommandColumn to determine the index of the item selected in the System.Web.UI.WebControls.DataGrid control to edit.

This property is also used to programmatically control which item is being edited. Setting this property to an index of an item in the System.Web.UI.WebControls.DataGrid control will enable editing controls for that item in the System.Web.UI.WebControls.EditCommandColumn.

Note:

The DataGrid.EditItemIndex property is zero based.

To cancel editing, programmatically set this property to -1.

Note:

Text is not HTML encoded before it is displayed in the System.Web.UI.WebControls.DataGrid control. This makes it possible to embed script within HTML tags in the text. If the values for the control come from user input, be sure to validate the values to reduce security vulnerabilities.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0