DxDataColumnBase.VisibleIndex Property

Specifies a column’s visible index.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
[DefaultValue(-1)]
public int VisibleIndex { get; set; }

Property Value

Type Default Description
Int32

-1

An index.

Remarks

Use this property to set the position of new columns or move the existing column to a new position.

NOTE

To reorder Data Grid columns at runtime, users can use the Column Chooser window. When a user changes column position from this window, the value of the column’s VisibleIndex property changes as well.

<DxDataGrid Data="@forecasts" >
    <DxDataGridCommandColumn Width="150px" VisibleIndex="0" />
    <DxDataGridColumn Field="@nameof(WeatherForecast.Date)" DisplayFormat="D" VisibleIndex="1" />
    <DxDataGridSpinEditColumn Field="@nameof(WeatherForecast.Forecast)" VisibleIndex="2" />
    @*...*@
</DxDataGrid>

Data Grid - A column visible index

If you disable a column’s Visible property, the hidden column does not store its last known VisibleIndex. When you set the Visible property back to true, the column is moved to the rightmost position.

See Also