windowsforms-devexpress-dot-xtralayout-dot-columndefinition.md
Gets or sets the column’s size type in a table layout.
Namespace : DevExpress.XtraLayout
Assembly : DevExpress.XtraLayout.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[XtraSerializableProperty]
public SizeType SizeType { get; set; }
<XtraSerializableProperty>
Public Property SizeType As SizeType
| Type | Description |
|---|---|
| SizeType |
A value that specifies the column’s size type.
|
In a table layout, a group’s width is distributed among columns according to their size types. Columns support three size types:
A table layout may contain rows and columns of different size types simultaneously. In this case, available space is distributed between rows and columns in the following order:
By default, after enabling table layout mode, two columns are automatically created. Their SizeType properties are set to Percent , and the Width properties are set to 50 , so they share the table layout equally. If you then add a new column at design time or append a new column with the default settings in code, the new column’s width type will be AutoSize.
Each time a column/row of the Percent size type is added to the table layout, or the size is changed for an existing Percent column/row, the Layout Control recalculates the sizes (ColumnDefinition.Width or RowDefinition.Height) of all existing Percent items, so that their sum equals to 100%, while keeping the proportions between the affected items.
Consider a table layout that contains two Percent columns whose widths are 40% and 60% respectively.
When you add another Percent column with the width equal to 80%, the widths of all the three columns will be automatically recalculated according to the expressions:
New width of column 1 = 40%*100% / (40% + 60% + 80%) = 22.222...%``New width of column 2 = 60%*100% / (40% + 60% + 80%) = 33.333...%``New width of column 3 = 80%*100% / (40% + 60% + 80%) = 44.444...%
In the case of multiple column modifications, you may want to avoid width recalculation of Percent columns/rows until all the modifications are made. To accomplish this, wrap the modification code in the LayoutControl.BeginUpdate and LayoutControl.EndUpdate method calls.
See Also