Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeListExportCustomizeCellEventArgs.Value Property

Specifies the value of the current cell.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public object Value { get; set; }

#Property Value

Type Description
Object

The cell value.

#Remarks

The CustomizeCell action allows you to customize a cell in the exported file. Use the Value property to get or set the value of the currently processed cell.

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

The following example modifies the Employee Name column value:

Razor
@using DevExpress.Export

<DxButton Text="Export to XLSX" Click="ExportXlsx_Click" />

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" @ref="MyTreeList">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

@code {
    ITreeList MyTreeList { get; set; }

    async Task ExportXlsx_Click() {
        await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
            CustomizeCell = OnCustomizeCell
        });
    }
    void OnCustomizeCell(TreeListExportCustomizeCellEventArgs args) {
        if (args.AreaType == SheetAreaType.DataArea && args.ColumnFieldName == "EmployeeName") {
            args.Value = (string)args.Value + " is responsible";
        }
        args.Handled = true;
    }
}
See Also