menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeGridExcelExportOptions - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeGridExcelExportOptions

    Represent a class that provides various properties and event handlers to customize the exporting of SfTreeGrid data to an Excel file.

    Inheritance
    System.Object
    TreeGridExcelExportOptions
    Namespace: Syncfusion.UI.Xaml.TreeGrid.Export
    Assembly: Syncfusion.GridExport.WinUI.dll
    Syntax
    public class TreeGridExcelExportOptions : Object

    Constructors

    TreeGridExcelExportOptions()

    Declaration
    public TreeGridExcelExportOptions()

    Fields

    ExcludedColumns

    Gets or sets a list of columns that will be excluded from the export.

    Declaration
    public List<string> ExcludedColumns
    Field Value
    Type
    System.Collections.Generic.List<System.String>

    Properties

    CanExportColumnWidth

    Gets or sets a value indicating whether the column widths of the SfTreeGrid should be used during export.

    Declaration
    public bool CanExportColumnWidth { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the column widths of the SfTreeGrid are applied to the exported Excel sheet; otherwise, false. When this property is set to false, the default column widths are applied to the exported sheet. The default value is true.

    CanExportMergedCells

    Gets or sets a value indicating whether merged cells should be exported.

    Declaration
    public bool CanExportMergedCells { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if merged cells should be exported; otherwise, false. The default value is false.

    CanExportStackedHeaders

    Gets or sets a value indicating whether stacked headers should be exported.

    Declaration
    public bool CanExportStackedHeaders { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if stacked headers should be exported; otherwise, false. The default value is false.

    CellsExportHandler

    Gets or sets the value that is used to handle or customize the exporting of a particular cell in the Excel document.

    Declaration
    public TreeGridCellExcelExport CellsExportHandler { get; set; }
    Property Value
    Type Description
    TreeGridCellExcelExport

    A TreeGridCellExcelExport delegate that can be used to handle or customize the exporting of a particular cell in the Excel document.

    Examples
    var options = new TreeGridExcelExportOptions();
    options.CellsExportHandler= CellsExportHandler;
    private void CellsExportHandler(object sender, TreeGridCellExcelExportOptions e)
    {
       if (e.CellType == ExportCellType.RecordCell && e.ColumnName == "Availability")
       {
           if (e.CellValue.Equals(true))
               e.Range.Cells[0].Value = "Y";
    
           else
               e.Range.Cells[0].Value = "N";
           e.Handled = true;
       }
    }

    Columns

    Gets a list of columns, excluding any specified in the ExcludedColumns property.

    Declaration
    public List<string> Columns { get; }
    Property Value
    Type
    System.Collections.Generic.List<System.String>

    DefaultColumnWidth

    Gets or sets the default column width for the exported Excel sheet.

    Declaration
    public double DefaultColumnWidth { get; set; }
    Property Value
    Type
    System.Double

    DefaultRowHeight

    Gets or sets the default row height for the exported Excel sheet.

    Declaration
    public double DefaultRowHeight { get; set; }
    Property Value
    Type
    System.Double

    ExcelVersion

    Gets or sets the Excel version for the exported workbook.

    Declaration
    public ExcelVersion ExcelVersion { get; set; }
    Property Value
    Type Description
    ExcelVersion

    One of the ExcelVersion enumeration values that specifies the Excel version. The default value is Excel2010.

    ExportMode

    Gets or sets the export mode for the data.

    Declaration
    public ExportMode ExportMode { get; set; }
    Property Value
    Type Description
    ExportMode

    One of the ExportMode enumeration values that specifies how the data should be exported to Excel. The default value is Value.

    GridExportHandler

    Gets or sets the value that is used to customize the styles for header and record rows in the exported Excel document.

    Declaration
    public TreeGridExcelExport GridExportHandler { get; set; }
    Property Value
    Type Description
    TreeGridExcelExport

    A TreeGridExcelExport delegate that can be used to customize the styles of header and record rows in the exported Excel document.

    Examples
    var options = new TreeGridExcelExportOptions();
    options.GridExportHandler = GridExportHandler;
    private void GridExportHandler(object sender, TreeGridExcelExportStartOptions e)
    {
      if (e.CellType == ExportCellType.HeaderCell)
       {
           e.Style.Color = Color.Red;
           e.Style.Font.Color = ExcelKnownColors.White;
           e.Handled = true;
       }
    }

    NodeExpandMode

    Gets or sets the value that specifies how the data in the SfTreeGrid should be exported to Excel.

    Declaration
    public NodeExpandMode NodeExpandMode { get; set; }
    Property Value
    Type Description
    NodeExpandMode

    One of the NodeExpandMode enumeration values that specifies the node expand mode. The default mode is Default.

    Remarks

    This property allows you to specify how the data in the SfTreeGrid should be exported to Excel. You can choose to export the data in its expanded or collapsed state, or use the default state.

    ShowOutlines

    Gets or sets a value indicating whether the parent nodes in the SfTreeGrid should be exported with expand/collapse options.

    Declaration
    public bool ShowOutlines { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if outlining is enabled; otherwise, false. The default value is true.

    Remarks

    When set to true, the parent nodes in the exported Excel document will be outlined with expand/collapse options, allowing the user to expand and collapse the nodes to view the child nodes.

    StartColumnIndex

    Gets or sets the starting column index for the exported data in the Excel sheet.

    Declaration
    public int StartColumnIndex { get; set; }
    Property Value
    Type
    System.Int32

    StartRowIndex

    Gets or sets the starting row index for the exported data in the Excel sheet.

    Declaration
    public int StartRowIndex { get; set; }
    Property Value
    Type
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved