DataGridItem::DataItem Property

 

Gets or sets the data item represented by the DataGridItem object in the DataGrid control.

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

public:
property Object^ DataItem {
	virtual Object^ get();
	virtual void set(Object^ value);
}

Property Value

Type: System::Object^

A System::Object that represents a data item in the DataGrid control.

Use the DataItem property to specify or determine the properties of a data item represented by the DataGridItem object in the DataGrid control.

System_CAPS_noteNote

This property applies only to data items in the DataGrid control. The ItemType property must be set to ListItemType.Item, ListItemType.AlternatingItem, ListItemType.SelectedItem, or ListItemType.EditItem.

The following code example demonstrates how to use the DataItem property to display the contents of the data items in the DataGrid control.

System_CAPS_noteNote

The following code example uses the single-file code model and might not work correctly if copied directly into a code-behind file. This code example must be copied into an empty text file that has an .aspx extension.

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

.NET Framework
Available since 1.1
Return to top
Show: