Skip to main content

DxDataColumnBase.VisibleIndexChanged Event

Fires when the column’s visible index changes.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<int> VisibleIndexChanged { get; set; }

Parameters

Type Description
Int32

A new value of the VisibleIndex property.

Remarks

The VisibleIndexChanged event fires each time the VisibleIndex property value changes. The event is handled automatically when you use two-way data binding for the VisibleIndex property (@bind-VisibleIndex).

@inject WeatherForecastService ForecastService

<DxDataGrid Data="@forecasts">
    <HeaderTemplate>
        <DxToolbar>
            <DxDataGridColumnChooserToolbarItem Alignment="ToolbarItemAlignment.Right" />
        </DxToolbar>
    </HeaderTemplate>
    <Columns>
        <DxDataGridDateEditColumn Caption="Date"
                                  Field="Date"
                                  @bind-VisibleIndex="VisibleIndex" />
        <DxDataGridColumn Field="TemperatureF"/>
        <DxDataGridColumn Field="TemperatureC" />
    </Columns>
</DxDataGrid>

<p>The Date column's visible index is <b>@VisibleIndex</b></p>

@code {
    int VisibleIndex { get; set; } = 0;
    private WeatherForecast[] forecasts;

    protected override async Task OnInitializedAsync() {
        forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
    }
}
See Also