windowsforms-devexpress-dot-xtraverticalgrid-dot-rows-dot-multieditorrowproperties.md
Gets or sets the width of a row item.
Namespace : DevExpress.XtraVerticalGrid.Rows
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
[DefaultValue(20)]
[DXCategory("Layout")]
[XtraSerializableProperty(XtraSerializationFlags.AutoScaleX)]
public int Width { get; set; }
<DefaultValue(20)>
<XtraSerializableProperty(XtraSerializationFlags.AutoScaleX)>
<DXCategory("Layout")>
Public Property Width As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 20 |
An integer representing a row item’s width.
|
Use the Width property to specify a particular row item width within a multi-editor row. The row item’s width applies to both the header and data cells’ width. Note that the Width property does not specify the actual width of a header/data cell in pixels, instead it is expressed proportionally as part of the overall width.
The value of the Width property is a partial expression - the widths of header/data cells are set proportionally with respect to the Width property of each multi-editor row item provided that their total width is equal to the VGridControlBase.RowHeaderWidth property.
Generally, the actual width (in pixels) of a particular row item’s header cell can be calculated using the following formula:
_ Row item width in pixels = MultiEditorRowProperties.Width * (VGridControlBase.RowHeaderWidth / ( Sum of MultiEditorRowProperties.Width values of all row items))_
In a similar manner the actual width (in pixels) can be calculated for an individual row item’s data cell:
_ Row item width in pixels = MultiEditorRowProperties.Width * (VGridControlBase.RecordWidth / ( Sum of MultiEditorRowProperties.Width values of all row items))_
The image below demonstrates how the Width values set for row items can be represented in pixels.
Row item width can be modified by end-users and via code. End-users can change the width of a row item by dragging a multi editor cell separator related to the row item. Row resizing is allowed for end-users only if the multi-editor row’s VGridOptionsRow.AllowSize option is enabled. Unlike end-users, you can modify the width of row items programmatically regardless of the VGridOptionsRow.AllowSize option setting.
When resizing a row item and changing the Width property either via code or by dragging a cell separator, the row item doesn’t become shorter than the width specified in the MultiEditorRowProperties.MinWidth property. So the Width property cannot be set to a value less than the MultiEditorRowProperties.MinWidth property.
Each time the row item width is successfully changed either by end-users or via code, the grid control sequentially generates the following two events: VGridControlBase.RowChanging and VGridControlBase.RowChanged. You can handle these events to perform specific actions before and after a row item’s width changes.
See Also
MultiEditorRowProperties Class