Skip to main content

GridViewExportDetailRowEventArgs.DataItem Property

Gets an object which is the current master grid row.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public object DataItem { get; }

Property Value

Type Description
Object

A Object value which represents the templated item object being rendered.

Remarks

Use this property to access the values of the current master grid row.

The code sample below demonstrates how to use this property to retrieve a “CategoryID” field value from the grid row.

// ...
// This code retrieves data for the detailed grid when performing the export.
settings.SettingsExport.GetExportDetailGridViews = (s, e) =>
{
    int categoryID = (int)DataBinder.Eval(e.DataItem, "CategoryID");
    GridViewExtension grid = new GridViewExtension(GetDetailGridSettings(categoryID));
    var products = new MasterDetailExportDemo.Models.northwndEntities().Products;
    var model = from product in products where product.CategoryID == categoryID select product;
    grid.Bind(model.ToList());
    e.DetailGridViews.Add(grid);
};

Note

The complete code sample is available in the Exporting Master-Detail Records topic.

See Also