| True DBGrid for WinForms Task-Based Help > Setting the Grid's Appearance > Setting Multiple Height Values for Rows |
To set multiple height values for rows, set the AllowRowSizing property to IndividualRows then assign height values to rows.
Complete the following steps:
In the Designer
Locate the AllowRowSizing property in the Properties window and set it to IndividualRows.
In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1TrueDBGrid1.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.IndividualRows |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1TrueDBGrid1.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizing.IndividualRows; |
|
Assign different row heights to the first two rows by adding the following code to the Form_Load event:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1TrueDBGrid1.Splits(0).Rows(0).Height = 25 Me.C1TrueDBGrid1.Splits(0).Rows(1).Height = 50 |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1TrueDBGrid1.Splits[0].Rows[0].Height = 25; this.c1TrueDBGrid1.Splits[0].Rows[1].Height = 50; |
|
The first row is set to 25 and the second row is set to 50: