windowsforms-devexpress-dot-xtralayout-dot-rowdefinition.md
Gets or sets the row’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 row’s size type.
|
In a table layout, a group’s height is distributed among rows according to their size types. Rows 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 rows are automatically created. Their SizeType properties are set to Percent , and the Height properties are set to 50 , so they share the table layout equally. If you then add a new row at design time or append a new row with the default settings in code, the new row’s height 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 rows whose widths are 40% and 60% respectively.
When you add another Percent row with the height equal to 80%, the heights of all the three rows will be automatically recalculated according to the expressions:
New height of row 1 = 40%*100% / (40% + 60% + 80%) = 22.222...%``New height of row 2 = 60%*100% / (40% + 60% + 80%) = 33.333...%``New height of row 3 = 80%*100% / (40% + 60% + 80%) = 44.444...%
In the case of multiple row modifications, you may want to avoid height 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