Skip to main content
All docs
V24.1

GridXlExportOptions.ShowHeaderBands Property

Specifies whether the grid exports header bands.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(true)]
public bool ShowHeaderBands { get; set; }

Property Value

Type Default Description
Boolean true

true to export header bands; otherwise, false.

Remarks

Set the ExportHeaderBands property to false to prevent the grid from exporting banded columns.

<DxGrid @ref="Grid" Data="@Data" >
    <Columns>
        <DxGridBandColumn Caption="Company">
            <Columns>
                <DxGridDataColumn FieldName="ContactName" />
                <DxGridDataColumn FieldName="ContactTitle" />
                <DxGridDataColumn FieldName="CompanyName" />
            </Columns>
        </DxGridBandColumn>
        <DxGridDataColumn FieldName="Country" />
        <DxGridDataColumn FieldName="FullAddress" />
</Columns>
</DxGrid>
<DxButton Text="Export to XLSX" Click="ExportXlsx_Click" />

@code {
    IEnumerable<object> Data { get; set; }
    IGrid Grid { get; set; }
    protected override async Task OnInitializedAsync() {
        Data = await NwindDataService.GetCustomersAsync();
    }
    async Task ExportXlsx_Click() {
        await Grid.ExportToXlsxAsync("ExportResult", new GridXlExportOptions() {
            ExportHeaderBands = false,
        });
    }
}
See Also