---
title: "GridWorksheet.AutoFitRows"
url: "https://reference.aspose.com/cells/net/aspose.cells.gridweb.data/gridworksheet/autofitrows/"
product: "Aspose.Cells for .NET API Reference"
description: "GridWorksheet method. Autofits all rows in this worksheet"
---

## AutoFitRows() {#autofitrows}

Autofits all rows in this worksheet.

```csharp
public void AutoFitRows()
```

### See Also

* class [GridWorksheet](../)
* namespace [Aspose.Cells.GridWeb.Data](../../../aspose.cells.gridweb.data/)
* assembly [Aspose.Cells.GridWeb](../../../)

---

## AutoFitRows(bool) {#autofitrows_1}

Autofits all rows in this worksheet.

```csharp
public void AutoFitRows(bool onlyAuto)
```

| Parameter | Type | Description |
| --- | --- | --- |
| onlyAuto | Boolean | True,only autofits the row height when row height is not customed. |

### See Also

* class [GridWorksheet](../)
* namespace [Aspose.Cells.GridWeb.Data](../../../aspose.cells.gridweb.data/)
* assembly [Aspose.Cells.GridWeb](../../../)

---

## AutoFitRows(int, int) {#autofitrows_2}

Autofits row height in a range.

```csharp
public void AutoFitRows(int startRow, int endRow)
```

| Parameter | Type | Description |
| --- | --- | --- |
| startRow | Int32 | Start row index. |
| endRow | Int32 | End row index. |

### See Also

* class [GridWorksheet](../)
* namespace [Aspose.Cells.GridWeb.Data](../../../aspose.cells.gridweb.data/)
* assembly [Aspose.Cells.GridWeb](../../../)


