Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridColumnFixedPosition Enum

Lists values that specify column behavior when a user scrolls the Grid horizontally.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public enum GridColumnFixedPosition

#Members

Name Description
None

The column is moved when a user scrolls the Grid horizontally.

Left

The column is anchored to the Grid’s left edge and remains visible when a user scrolls the Grid horizontally.

Right

The column is anchored to the Grid’s right edge and remains visible when a user scrolls the Grid horizontally.

#Related API Members

The following properties accept/return GridColumnFixedPosition values:

#Remarks

The Grid component displays a horizontal scrollbar when the total width of all its columns exceeds the size of the component itself. Use a column’s FixedPosition property to freeze the column and keep it visible on screen while users scroll the grid horizontally. The following code snippet anchors the Ship Name and Shipped Date columns to the left and rigth grid edges:

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<style>
    .my-class {
        width: 950px;
    }
</style>

<DxGrid Data="Data" CssClass="my-class">
    <Columns>
        <DxGridDataColumn FieldName="ShipName" FixedPosition="GridColumnFixedPosition.Left" Width="250px" />
        <DxGridDataColumn FieldName="ShipAddress" Width="350px" />
        <DxGridDataColumn FieldName="ShipCity" Width="200px" />
        <DxGridDataColumn FieldName="ShipPostalCode" Width="150px" />
        <DxGridDataColumn FieldName="ShipCountry" Width="200px" />
        <DxGridDataColumn FieldName="Freight" Width="100px" />
        <DxGridDataColumn FieldName="OrderDate" DisplayFormat="d" Width="120px" />
        <DxGridDataColumn FieldName="ShippedDate" FixedPosition="GridColumnFixedPosition.Right" Width="120px" />
    </Columns>
</DxGrid>

@code {
    IEnumerable<object> Data { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override async Task OnInitializedAsync() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Data = await Northwind.Orders.ToListAsync();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}
See Also