GridViewExportDetailRowEventArgs.DataItem Property

Gets an object which is the current master grid row.

Namespace: DevExpress.Web.Mvc

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


public object DataItem { get; }

Property Value

Type Description

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


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;


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

See Also