Skip to main content

GridViewExportDetailRowEventArgs.DetailGridViews Property

Provides access to a collection of detail grids.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public List<GridViewExtension> DetailGridViews { get; }

Property Value

Type Description
List<GridViewExtension>

A list of the GridViewExtension objects that are detail grids.

Remarks

Using this property, you can access the collection of detail grids and add a new detail grid to this collection.

The code sample below demonstrates how to add a detail grid to the DetailGridViews collection.

// ...
// 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());
    // Adding a detail grid to a DetailGridViews collection.
    e.DetailGridViews.Add(grid);
};

Note

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

See Also