Skip to main content
All docs
V25.1
  • TreeListExportCustomizeCellEventArgs.Formatting Property

    Specifies an object that defines cell formatting settings (font, alignment, background color, format string, etc.).

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public XlFormattingObject Formatting { get; set; }

    Property Value

    Type Description
    XlFormattingObject

    Cell formatting settings.

    Remarks

    The CustomizeCell action allows you to customize a cell in the exported file. Use the Formatting property to format cell value and appearance.

    Set the Handled property to true to apply changes made to the cell in the action handler.

    The following example adds a hyperlink to the document’s Name column:

    async Task ExportXlsx_Click() {
        await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
            CustomizeCell = CustomizeCell
        });
    }
    void CustomizeCell(TreeListExportCustomizeCellEventArgs e) {
        if (e.AreaType == DevExpress.Export.SheetAreaType.DataArea) {
            e.Formatting.BackColor = System.Drawing.Color.LightYellow;
        }
        // Set the Handled property to true to apply the specified settings
        e.Handled = true;
    }
    
    See Also