Back to Devexpress

GridOptionsPrint.PrintDetails Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridoptionsprint-d5e50561.md

latest4.5 KB
Original Source

GridOptionsPrint.PrintDetails Property

Gets or sets whether to print/export currently expanded details (in master-detail mode). This property is not in effect when you export the View in Microsoft Excel format in Data-aware export mode.

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool PrintDetails { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property PrintDetails As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

false , to print/export master rows without details; true to print/export master rows along with currently expanded details.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to PrintDetails
GridView

.OptionsPrint .PrintDetails

|

Remarks

Enable the GridOptionsPrint.ExpandAllDetails property to automatically expand all master rows before a print/export operation.

The PrintDetails option is not in effect when you export the View in Microsoft Excel format in Data-aware export mode.

Example - 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.
csharp
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();
vb
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.Utils
Imports DevExpress.XtraGrid.Views.Base

Dim masterView As GridView = gridView1
masterView.OptionsDetail.DetailMode = DetailMode.Classic

Dim rowHandle As Integer = 3
masterView.ExpandMasterRow(rowHandle)
Dim detailView As ColumnView = TryCast(gridView1.GetDetailView(rowHandle, 0), ColumnView)
detailView.ZoomView()
detailView.ExportToXlsx("c:\Temp\export.xlsx")
detailView.NormalView()

See Also

ExpandAllDetails

Export and Printing

Export to XLS and XLSX Formats

GridOptionsPrint Class

GridOptionsPrint Members

DevExpress.XtraGrid.Views.Grid Namespace