Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Export a Specific Detail View

Do the following to export a specific detail View (without a master row):

  1. Access a detail View (see Patterns and Clones).
  2. Maximize (zoom) this detail View with the BaseView.ZoomView method, or the Zoom Button.
  3. Export the detail View. For instance, use the BaseView.ExportToXlsx method.
  4. Restore the initial layout using the detail View’s NormalView method.
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Base;

GridView masterView = gridView1;
masterView.OptionsDetail.DetailMode = DetailMode.Classic;

int rowHandle = 3;
masterView.ExpandMasterRow(rowHandle);
ColumnView detailView = gridView1.GetDetailView(rowHandle, 0) as ColumnView;
detailView.ZoomView();
detailView.ExportToXlsx("c:\\Temp\\export.xlsx");
detailView.NormalView();