GridView.RowHeight Property
Gets or sets the cell height within data rows.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
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;
}
};
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the RowHeight property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.