System.Web.UI.WebControls Namespace RepeaterItem Class
Sets or retrieves a data item associated with the RepeaterItem.
Script |
RepeaterItem.DataItem [ = var ] |
var |
Object representing a data item in a Repeater control. |
The property is read/write with no default value.
Use the DataItem property to specify or determine the properties of a data item associated with a RepeaterItem object in the Repeater control.
DataItem is mainly used to bind a field from the data source to a control on the RepeaterItem.
For any of the templated list controls, such as DataList, DataGrid, or Repeater, this property provides the object reference against which a databinding expression is evaluated, and should always be set to Container.DataItem. DataItem provides the navigation path from the container to the property value to be placed in the bound control.
NOTE: This property only applies to data items in the Repeater control. The ItemType property must be set to ListItemType.Item or ListItemType.AlternatingItem.
RepeaterItem Members