DxDataGridColumn.Caption Property

Specifies the column’s caption.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public string Caption { get; set; }

Property Value

Type Description
String

The column’s caption.

Remarks

Use the Caption property to specify a custom column caption.

If this property is set to an empty string, the Data Grid generates a user-friendly column caption based on the field name (the Field property value). The Grid adds space characters between parts of the field name that begin with uppercase letters. For instance, the “Temperature C“ caption is displayed for the TemperatureC field.

@inject WeatherForecastService ForecastService

<DxDataGrid DataAsync="@ForecastService.GetForecastAsync">
    <DxDataGridDateEditColumn Field=@nameof(WeatherForecast.Date)></DxDataGridDateEditColumn>
    <DxDataGridColumn Field=@nameof(WeatherForecast.TemperatureC) Caption="Temp. (C)"></DxDataGridColumn>
    <DxDataGridSpinEditColumn Field=@nameof(WeatherForecast.TemperatureF) Caption="Temp. (F)">
    </DxDataGridSpinEditColumn>
</DxDataGrid>

@code {
    public class WeatherForecast {
        public DateTime Date { get; set; }
        public int TemperatureC { get; set; }
        public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
    }
}

Data Grid - Custom column caption

Online Demo

Data Grid - Column Types

See Also