Skip to main content
All docs
V25.2
  • TreeListDocumentExportOptions.SelectedRowsExportMode Property

    In ExportSelectedRowsOnly mode, specifies whether to export parents of selected rows.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.2.dll

    Declaration

    [DefaultValue(TreeListSelectedRowsExportMode.Flat)]
    public TreeListSelectedRowsExportMode SelectedRowsExportMode { get; set; }

    Property Value

    Type Default Description
    TreeListSelectedRowsExportMode Flat

    An enumeration value.

    Available values:

    Name Description
    Flat

    The TreeList exports selected rows as a flat list.

    KeepHierarchy

    The TreeList exports selected rows and parents (even if parent rows are unselected).

    Remarks

    Note

    This property is not in effect if ExportSelectedRowsOnly is set to false (default).

    When exporting TreeList data to PDF, you can activate the ExportSelectedRowsOnly option. If active, the TreeList component ignores hierarchy and exports selected rows as flat data.

    PDF Export - Flat Selected Rows Export Mode

    Set SelectedRowsExportMode to KeepHierarchy to export selected rows and their parents:

    PDF Export - Keep Hierarchy Selected Rows Export Mode

    @rendermode InteractiveServer
    @using DevExpress.Drawing
    @inject SpaceObjectDataProvider SpaceObjectDataProvider
    
    <DxTreeList @ref="TreeList" Data="TreeListData" ChildrenFieldName="Satellites">
        <Columns>
            <DxTreeListSelectionColumn Width="60px" AllowSelectAll="true" />
            <DxTreeListDataColumn FieldName="Name" />
            <DxTreeListDataColumn FieldName="TypeOfObject" Caption="Type" />
            <DxTreeListDataColumn FieldName="Mass10pow21kg" Caption="Mass, kg" DisplayFormat="N2" />
            <DxTreeListDataColumn FieldName="MeanRadiusInKM" Caption="Radius, km" DisplayFormat="N2"/>
        </Columns>
        <ToolbarTemplate>
            <DxToolbar>
                <DxToolbarItem Text="Export to PDF" Click="ExportPdf_Click" BeginGroup="true" />
            </DxToolbar>
        </ToolbarTemplate>
    </DxTreeList>
    
    @code {
        ITreeList TreeList { get; set; }
        object TreeListData { get; set; }
    
        protected override async Task OnInitializedAsync() {
            TreeListData = SpaceObjectDataProvider.GenerateData();
        }
        async Task ExportPdf_Click() {
            await TreeList.ExportToPdfAsync("ExportResult", new TreeListPdfExportOptions() {
                ExportSelectedRowsOnly = true,
                SelectedRowsExportMode = TreeListSelectedRowsExportMode.KeepHierarchy
            });
        }
    }
    

    Read Tutorial: Export to PDF Run Demo: Export Data

    See Also