# Sizing

FlexGrid for WinForms provides options to size the row height such as auto-adjust, setting bounds etc. Learn more about how to resize the grid rows here.

## Content

## Set Row Height

FlexGrid provides <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022C1.Win.FlexGrid.5~C1.Win.FlexGrid.RowColCollection~DefaultSize.html\u0022\u003e.NET\u003c/a\u003e." data-popup-title="DefaultSize" data-popup-theme="ui-tooltip-green qtip-green">DefaultSize</span> property of the <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="RowCollection" data-popup-theme="ui-tooltip-green qtip-green">RowCollection</span> class to set row height across the grid. You can also specify the height of a particular row by setting **Height** property of the <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="Row" data-popup-theme="ui-tooltip-green qtip-green">Row</span> class. Default value of the **Height** property is -1 which indicates that the row is taking height specified by the **DefaultSize** property.

Use the code below to set the default height of a row of the WinForms FlexGrid.

```csharp
//Set the default size of all rows
c1FlexGrid1.Rows.DefaultSize = 50;
//Set the height of a particular row
c1FlexGrid1.Rows[1].Height = 55;                       
```

```vbnet
' Set the default size of all rows
c1FlexGrid1.Rows.DefaultSize = 50
' Set the height of a particular row
c1FlexGrid1.Rows(1).Height = 55
```

## Auto-adjust Row Height

To adjust the row height according to text length and word wrapping options, FlexGrid provides the <span data-popup-content="This method is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="AutoSizeRow()" data-popup-theme="ui-tooltip-green qtip-green">AutoSizeRow()</span> and **AutoSizeRows()** methods. While **AutoSizeRow()** method automatically adjusts height of the specified row, the **AutoSizeRows()** method is used for cell ranges.

Following code shows how you can auto adjust the row height according to the text length in the WinForms FlexGrid.

```csharp
//Adjust the height of fourth row automatically
c1FlexGrid1.AutoSizeRow(4);
//Adjust the height of all rows automatically 
c1FlexGrid1.AutoSizeRows();
//Adjust the height of cell range automatically
//c1FlexGrid1.AutoSizeRows(2, 4, 5, 6, 10, C1.Win.C1FlexGrid.AutoSizeFlags.None);
```

```vbnet
'Adjust the height of fourth row automatically
    c1FlexGrid1.AutoSizeRow(4)
'Adjust the height of all rows automatically 
    c1FlexGrid1.AutoSizeRows()
'Adjust the height of cell range automatically
    'c1FlexGrid1.AutoSizeRows(2, 4, 5, 6, 10, C1.Win.C1FlexGrid.AutoSizeFlags.None)
                        
```

## Set Min/Max Row Height

FlexGrid allows you to set bounds to the row height by using the <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022C1.Win.FlexGrid.5~C1.Win.FlexGrid.RowColCollection~MinSize.html\u0022\u003e.NET\u003c/a\u003e." data-popup-title="MinSize" data-popup-theme="ui-tooltip-green qtip-green">MinSize</span> and <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022C1.Win.FlexGrid.5~C1.Win.FlexGrid.RowColCollection~MaxSize.html\u0022\u003e.NET\u003c/a\u003e." data-popup-title="MaxSize" data-popup-theme="ui-tooltip-green qtip-green">MaxSize</span> properties of the <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="RowCollection" data-popup-theme="ui-tooltip-green qtip-green">RowCollection</span> class. This feature is especially useful in scenarios such as when <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="AllowResizing" data-popup-theme="ui-tooltip-green qtip-green">AllowResizing</span> property is set to **true** or while using the **AutoSizeRow()** or **AutoSizeRows()** method.

Specify the bounds of row height in the WinForms FlexGrid using the code below.

```csharp
//Set the maximum height of row
c1FlexGrid1.Rows.MaxSize = 50;
//Set the minimum height of row
c1FlexGrid1.Rows.MinSize = 20;
```

```vbnet
'Set the maximum height of row
c1FlexGrid1.Rows.MaxSize = 50
'Set the minimum height of row
 c1FlexGrid1.Rows.MinSize = 20      
```

## See Also

**Documentation**

[Column Sizing](/componentone/docs/win/online-flexgrid/concepts/basic-column-operation/column-sizing)