MVCxGridViewExportSettings.GetExportDetailGridViews Property
Enables you to populate the collection of detail grids that correspond to individual records within the master GridView.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.1.dll
NuGet Package: DevExpress.Web.Mvc5
Declaration
Property Value
Type | Description |
---|---|
GridViewGetExportDetailGridViewEventHandler | A GridViewGetExportDetailGridViewEventHandler delegate method to be called when exporting detail grids. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to GetExportDetailGridViews |
---|---|
GridViewSettings |
|
Remarks
Implement a GridViewGetExportDetailGridViewEventHandler delegate method and assign it to the GetExportDetailGridViews property. For more implementation details, refer to the GridViewGetExportDetailGridViewEventHandler delegate description.
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.