Back to Devexpress

GridViewColumn.FixedStyle Property

aspnet-devexpress-dot-web-dot-gridviewcolumn-941cd660.md

latest3.2 KB
Original Source

GridViewColumn.FixedStyle Property

Gets or sets whether the column is fixed on the ASPxGridView’s left edge.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(GridViewColumnFixedStyle.None)]
public GridViewColumnFixedStyle FixedStyle { get; set; }
vb
<DefaultValue(GridViewColumnFixedStyle.None)>
Public Property FixedStyle As GridViewColumnFixedStyle

Property Value

TypeDefaultDescription
GridViewColumnFixedStyleNone

A GridViewColumnFixedStyle enumeration value that specifies whether the column is fixed on the ASPxGridView’s left edge.

|

Available values:

NameDescription
None

A column isn’t fixed to a grid’s left edge, can be moved by dragging, and takes part in horizontal scrolling.

| | Left |

A column is anchored to a grid’s left edge.

|

Remarks

If the total column width exceeds the ASPxGridView’s width and the grid displays the horizontal scrollbar, end users can scroll the grid’s contents column by column. Additionally, you can set the column’s FixedStyle property to GridViewColumnFixedStyle.Left to freeze individual columns. This allows your end users to scroll through the other columns.

aspx
<dx:ASPxGridView ID="Grid" >
    <Columns>
        <dx:GridViewDataColumn FieldName="ContactName" Width="150" FixedStyle="Left" />
        <dx:GridViewDataColumn FieldName="CompanyName" Width="180" FixedStyle="Left" />
        <dx:GridViewDataColumn FieldName="City" Width="130" />
        ...
    </Columns>
    <Settings HorizontalScrollBarMode="Visible" />
    <Styles>
        <FixedColumn BackColor="LightYellow" />
    </Styles>
</dx:ASPxGridView>

To display the horizontal scroll bar in the grid, use the ASPxGridSettings.HorizontalScrollBarMode property.

aspx
<dx:ASPxGridView ID="Grid" >
    <Columns>
        ...
    </Columns>
    <Settings HorizontalScrollBarMode="Visible" VerticalScrollBarMode="Visible" />
</dx:ASPxGridView>

Concept

Fixed Columns

Online Demo

ASPxGridView - Fixed Column

See Also

Grid View

GridViewColumn Class

GridViewColumn Members

DevExpress.Web Namespace