TreeListOptionsColumn.FixedWidth Property
Gets or sets whether the column’s width remains the same when the column’s auto width feature is enabled.
Namespace: DevExpress.XtraTreeList.Columns
Assembly: DevExpress.XtraTreeList.v25.2.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList
Declaration
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool FixedWidth { get; set; }
Property Value
| Type | Default | Description |
|---|---|---|
| Boolean | false |
|
Property Paths
You can access this nested property as listed below:
| Object Type | Path to FixedWidth |
|---|---|
| TreeListColumn |
|
Remarks
Use this property to keep a column at a constant width when TreeListOptionsView.AutoWidth is active and the control size changes.
The following code snippet enables automatic column width calculation and keeps one column fixed:
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;
TreeListColumn productNameColumn = treeList.Columns["ProductName"];
treeList.OptionsView.AutoWidth = true;
productNameColumn.OptionsColumn.FixedWidth = true;
To prevent a user from resizing this column at runtime, disable TreeListOptionsColumn.AllowSize. To limit the width instead of fully locking it, use TreeListColumn.MinWidth and TreeListColumn.MaxWidth.
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.