Skip to main content

DataViewItem.DataItem Property

Gets or sets the data item that is bound to the Item.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public object DataItem { get; set; }

Property Value

Type Description

A Object that represents the data item which is bound to the item.


Use the DataViewItemCollection.Add method to add data items in code-behind. In this case, a custom data object with the required properties should be assigned to the DataItem property value.

using DevExpress.Web;
    const int itemsCount = 10;
    protected void DataView_Load(object sender, System.EventArgs e) {
        DataView.ItemTemplate = new MyDataViewTemplate();
    void AddDataItems(ASPxDataView dataView) {
        for (int i = 1; i <= itemsCount; i++) {
            dataView.Items.Add().DataItem = new {
                ID = i,
                Name = "Name" + i,
                Description = "Sample description for the item"
See Also