Skip to main content

OptionsColumn.FixedWidth Property

Gets or sets whether the column keeps a constant width when a Grid changes its size or Best Fit operations are called. End users are still allowed to resize this column.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v25.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

[DefaultValue(false)]
[XtraSerializableProperty]
public bool FixedWidth { get; set; }

Property Value

Type Default Description
Boolean false

true if the column keeps its width; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to FixedWidth
GridColumn
.OptionsColumn .FixedWidth

Remarks

The code below illustrates how to lock the “Product Name” column’s width.

colProductName.OptionsColumn.FixedWidth = true;

If there is a Band that contains only one column, and you want to lock this column’s width, enable the Band’s OptionsBand.FixedWidth property instead.

Users are free to resize any Grid column at runtime, including columns with fixed widths. To lock or limit column widths at runtime, do one of the following:

See the Columns help topic to learn more.

Note

When FixedWidth is active for a column and a user drags the preceding column’s right edge, only the preceding column is resized.

This occurs because the FixedWidth property affects passive resizing (resizing triggered by changes to another column or the control itself). The actively resized column is the preceding column, so the column with FixedWidth enabled cannot change its width in response to changes to other columns, and the preceding column absorbs the size adjustment.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FixedWidth 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.

See Also