Back to Devexpress

TreeListXlExportOptions.CustomizeColumn Property

blazor-devexpress-dot-blazor-dot-treelistxlexportoptions.md

latest1.5 KB
Original Source

TreeListXlExportOptions.CustomizeColumn Property

Allows you to customize an individual column in the exported document.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public Action<TreeListExportCustomizeColumnEventArgs> CustomizeColumn { get; set; }

Property Value

TypeDescription
Action<TreeListExportCustomizeColumnEventArgs>

A delegate method that customizes a column.

|

Remarks

Implement the CustomizeColumn action delegate to customize an individual column in the exported document: change its width or formatting, or hide the column.

The following code snippet changes the column width in the exported document:

csharp
async Task ExportXlsx_Click() {
    await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
        CustomizeColumn = CustomizeColumn
    });
}
void CustomizeColumn(TreeListExportCustomizeColumnEventArgs e) {
    if (e.FieldName == "Name")
        e.Column.WidthInPixels = 300;
}

See Also

TreeListXlExportOptions Class

TreeListXlExportOptions Members

DevExpress.Blazor Namespace