This documentation is archived and is not being maintained.
ListViewDataItem::DataItem Property
Visual Studio 2010
Gets or sets the underlying data object that the ListViewItem object is bound to.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
public: virtual property Object^ DataItem { Object^ get () override; void set (Object^ value) override; }
<asp:ListViewDataItem DataItem="Object" />
Property Value
Type: System::ObjectThe 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.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, 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.
Show: