windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-8b49d1b5.md
Gets or sets a value specifying whether the column takes part in horizontal View scrolling or is anchored to a View edge.
Namespace : DevExpress.XtraGrid.Columns
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DefaultValue(FixedStyle.None)]
[DXCategory("Behavior")]
[XtraSerializableProperty]
public virtual FixedStyle Fixed { get; set; }
<DXCategory("Behavior")>
<DefaultValue(FixedStyle.None)>
<XtraSerializableProperty>
Public Overridable Property Fixed As FixedStyle
| Type | Default | Description |
|---|---|---|
| FixedStyle | None |
A FixedStyle enumeration value.
|
Available values:
| Name | Description |
|---|---|
| None |
The band or column takes part in horizontal scrolling.
| | Left |
The band or column is anchored to the View’s left edge.
| | Right |
The band or column is anchored to the View’s right edge.
| | MiddleLeft |
The band or column is not anchored until a user scrolls it up to the left edge. When the column reaches the left edge, it becomes fixed while other columns continue to scroll. This style is not supported for bands.
|
If the GridOptionsView.ColumnAutoWidth option is set to false and the total column width exceeds the View width, you can scroll the View horizontally. If you need particular columns to be displayed on screen regardless of scrolling performed, set those columns’ Fixed property to either FixedStyle.Left or FixedStyle.Right.
You can anchor an unlimited number of columns to any View edge.
For additional information about fixed columns, read the Fixed Columns topic.
Note
If you apply grouping and the view’s OptionsBehavior.AllowPartialGroups property is active, a fixed column is displayed to the right of the grouped column.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Fixed property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-scrolling-by-columns/CS/WindowsApplication3/Form1.cs#L19
gridControl1.DataSource = ItemList.GetList();
gridView1.Columns[0].Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;
}
bool fixedWidthEnabled = Convert.ToBoolean(itemColumn.CustomProperties.GetValue(PropertyName));
gridColumn.Fixed = fixedWidthEnabled ? FixedStyle.Left : FixedStyle.None;
}
winforms-grid-scrolling-by-columns/VB/WindowsApplication3/Form1.vb#L17
gridControl1.DataSource = GetList()
gridView1.Columns(0).Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left
End Sub
Dim fixedWidthEnabled As Boolean = Convert.ToBoolean(itemColumn.CustomProperties.GetValue(PropertyName))
gridColumn.Fixed = If(fixedWidthEnabled, FixedStyle.Left, FixedStyle.None)
End If
See Also
Fixed