# Remove a Group

Learn how to remove a group using DsExcel by ungrouping the rows and columns, clearing the outline level, and collapsing a group.

## Content

You can remove a group by implementing the following tasks in your worksheet.

* [Ungroup rows and columns](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyGrouping/RemoveAGroup#ungroup-rows-and-columns)
* [Clear Outline](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyGrouping/RemoveAGroup#clear-outline)
* [Collapse a Group](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyGrouping/RemoveAGroup#collapse-a-group)

## Ungroup rows and columns

The grouped rows or columns can be ungrouped if you no longer want the information to be organized in clusters. You can increment or decrement the outline level for the specified rows or columns using the [Group method](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.Group.html) and [Ungroup method](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.Ungroup.html) of the [IRange interface](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.html) respectively.
Refer to the following example code to ungroup row and column in a worksheet.

```csharp
// Row Ungrouping
//1:5 rows' outline level will be 1.
worksheet.Range["1:5"].Ungroup();
            
// Column Ungrouping
//A:I columns outline level will be 2.
worksheet.Range["A:I"].Group();
//A:D columns outline level will be 1.
worksheet.Range["A:D"].Ungroup();
```

## Clear outline

You can clear the outline level of the specified rows or columns using the [ClearOutline method](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.ClearOutline.html) of the IRange interface.
Refer to the following example code to clear outline in a worksheet.

```csharp
//1:20 rows' outline level will be 2.
worksheet.Range["1:20"].Group();
//1:10 rows' outline level will be 3.
worksheet.Range["1:10"].Group();
            
//ClearOutline
//12:20 rows' outline level will be 1.
worksheet.Range["12:20"].ClearOutline();
```

## Collapse a group

You can collapse a group by setting the [ShowDetail property](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.ShowDetail.html) of the IRange interface to boolean false.
Refer to the following example code to collapse a group in a worksheet.

```csharp
//1:20 rows' outline level will be 2.
worksheet.Range["1:20"].Group();
//1:10 rows' outline level will be 3.
worksheet.Range["1:10"].Group();
//collapse
//1:10 rows will be collapsed.
worksheet.Range["11:11"].ShowDetail = false;
```