ListViewDataItem::DataItem Property
.NET Framework (current version)
Gets or sets the underlying data object that the ListViewItem object is bound to.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
public: property Object^ DataItem { virtual Object^ get() override; virtual void set(Object^ value) override; }
Property Value
Type: System::Object^The underlying data object that the ListViewItem object is bound to.
Implements
IDataItemContainer::DataItemThe DataItem property is available only during and after the ItemDataBound event of a ListView control.
The following example shows how to use the DataItem property to retrieve a field value. The value is then used to pre-select an item in a DropDownList control that is displayed when an item is in edit mode. This code example is part of a larger example that is provided for the ListViewDataItem class.
.NET Framework
Available since 3.5
Available since 3.5
Show: