GridView.RowHeight Property
Gets or sets the cell height within data rows.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v22.2.dll
NuGet Package: DevExpress.Win.Grid
Declaration
[DefaultValue(-1)]
[DXCategory("Appearance")]
[XtraSerializableProperty(XtraSerializationFlags.AutoScaleY)]
public int RowHeight { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Int32 | -1 | An integer value specifying the data cell height in pixels. |
Remarks
All data cells and rows have the same default height, the minimum height is that required to fit a single text line. The required height is automatically calculated based on font settings applied (except for the focused row style). If the RowHeight property value is -1, the calculated value specifies the actual height of data cells. You can set the RowHeight property to a positive integer to increase the cell height.
Note: in Advanced Banded Grid Views, cells can be arranged into several rows within a single data row. Thus, the actual height of a data row can be a multiple of the RowHeight property value.
Please refer to the Rows topic for information on how to specify the group rows height and how to apply variable heights to rows.
The code sample below illustrates how to change row height dynamically.
gridView.CalcRowHeight += (sender, e) => {
if(e.RowHandle % 2 == 0) {
e.RowHeight = 50;
}
};