blazor-devexpress-dot-blazor-dot-treelistxlexportoptions.md
Allows you to customize an individual column in the exported document.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public Action<TreeListExportCustomizeColumnEventArgs> CustomizeColumn { get; set; }
| Type | Description |
|---|---|
| Action<TreeListExportCustomizeColumnEventArgs> |
A delegate method that customizes a column.
|
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:
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