Category / Section
How to change the height of the row in WinForms GridControl?
2 mins read
Change the row height
The GridControl supports setting the height of the row by passing the row index in the RowHeight property or by using the QueryRowHeight event.
By using GridModel
C#
//Apply Rowheight to the Row 3. this.gridControl1.RowHeights[3] = 70;
VB
'Apply Rowheight to the Row 3. Me.gridControl1.RowHeights(3) = 70
By using QueryRowheight
C#
void gridControl1_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e) { // Apply Rowheights to the Row 3 if (e.Index == 3) { e.Size = 70; e.Handled = true; } }
VB
Private Sub gridControl1_QueryRowHeight(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs) 'Apply Rowheights to the Row 3 If e.Index = 3 Then e.Size = 70 e.Handled = True End If End Sub
After applying the properties, the row looks like the following screenshot.
Figure 1: Changing the row height
Samples:
C#: Change Height
VB: Change Height