DxDataGridColumnBase<T>.FixedStyle Property

Specifies whether the column is moved or anchored to the grid's edge when users scroll the grid horizontally.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v20.2.dll

Declaration

[Parameter]
[DefaultValue(DataGridFixedStyle.None)]
public DataGridFixedStyle FixedStyle { get; set; }

Property Value

Type Default Description
DataGridFixedStyle

None

A DataGridFixedStyle enumeration value.

Remarks

The Data Grid displays the horizontal scroll bar in the following cases:

You can freeze individual columns so that they always remain visible on screen while users scroll the grid horizontally. Set a column's FixedStyle property to DataGridFixedStyle.Left or DataGridFixedStyle.Right to anchor the column to the grid's left or right edge.

<DxDataGrid Data="@DataSource"
            HorizontalScrollBarMode="ScrollBarMode.Visible"
            PagerNavigationMode="PagerNavigationMode.NumericButtons">
    <DxDataGridCommandColumn Width="100px" FixedStyle="DataGridFixedStyle.Left" />
    <DxDataGridColumn Field="@nameof(ProductFlat.ProductName)" Width="250px" />
    <DxDataGridColumn Field="@nameof(ProductFlat.Availability)" Width="110px" 
                      FixedStyle="DataGridFixedStyle.Right">
        <DisplayTemplate>
            @*...*@
        </DisplayTemplate>
    </DxDataGridColumn>
    <DxDataGridColumn Field="@nameof(ProductFlat.Category)" Width="250px" />
    <DxDataGridColumn Field="@nameof(ProductFlat.Subcategory)" Width="250px" />
    <DxDataGridDateEditColumn Field="@nameof(ProductFlat.LastUpdated)" Width="250px" />
</DxDataGrid>

Data Grid Fixed Columns

You can anchor an unlimited number of columns to any grid edge. The display order of fixed columns corresponds to the order of these columns in the grid's markup or depends on the VisibleIndex property if it is specified explicitly.

Run Demo: Data Grid - Fixed Columns

See Also