DxDataGrid<T>.LayoutRestoring Event

Fires when a grid has been initialized and you can restore its layout (if needed).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.dll

Declaration

[Parameter]
public Action<IDataGridLayout> LayoutRestoring { get; set; }

Parameters

Type Description
IDataGridLayout

An object that implements the IDataGridLayout interface and provides information about a grid's layout.

Remarks

Handle the LayoutRestoring event to load a grid's saved layout. The layout information includes the current page, column sort order/direction, column position, filter values, and grouped columns.

NOTE

The saved layout does not include information about expanded rows in groups.

The code below demonstrates how to save and restore the grid's layout.

<DxDataGrid ...
    LayoutRestoring="@OnLayoutRestoring"
    LayoutChanged="@OnLayoutChanged">
</DxDataGrid>

@code {
     void OnLayoutChanged(IDataGridLayout dataGridLayout) {
        var layout = dataGridLayout.SaveLayout();
        // persist the layout in your storage
    }
    void OnLayoutRestoring(IDataGridLayout dataGridLayout) {
        var layout = … // restore layout from your storage
        dataGridLayout.LoadLayout(layout);
    }
}
See Also