Skip to main content
A newer version of this page is available. .

Fixed Columns

ASPxGridView allows you to anchor columns to its left edge. Fixed columns are not scrolled when you scroll the grid horizontally. Use this feature to keep a particular column (or columns) in the view.

Run Demo

Fix a column

To freeze a column, set its FixedStyle property to Left. Use the FixedColumn property to customize style settings of the fixed columns.

 <dx:ASPxGridView ID="Grid" runat="server" DataSourceID="CustomersDataSource" >
        <Columns>
            <dx:GridViewDataColumn FieldName="ContactName" Width="150" FixedStyle="Left" />
        </Columns>
        <Styles>
            <FixedColumn BackColor="LightYellow" />
        </Styles>
 </dx:ASPxGridView>

Scrolling

When a user scrolls a Grid View control horizontally, unfixed columns are hidden one by one and scrolling starts from the left border of the first unfixed column.

ASPxGridView_FixedColumns

If the last column’s width is larger than the scrollable area’s width, the control displays an empty space after the column.

ASPxGridView_FixedColumns

Use one of the following approaches to avoid this issue:

  • Use the ASPxGridView’s Width property to increase the width of the control.

    <dx:ASPxGridView ID="Grid" runat="server" DataSourceID="CustomersDataSource" Width="1000">
    
  • Use the Width property to decrease the column’s width.

    <dx:GridViewDataColumn FieldName="Fax" Width="100" />