# Interoperability of Grouping with Other Features

Understand the impact of grouping on features like alternating rows, clipboard paste, and error icons in Spread.

## Content

The grouping feature affects the display and is not intended to work with some other features of Spread that also work with the display of the spreadsheet. When grouping happens, the data model is changed and a new model (the [GroupDataModel](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Model.GroupDataModel.html)) is used. Many features are not affected by grouping at all, but some features, listed below, are not intended to operate with grouping. In general, if the feature involves the appearance or interactivity of the sheet or column, check the list to see if it is affected by grouping.
Some formatting features can work with grouping, but need to be applied after grouping occurs. If you need to format cells (colors, locked, and so on), you must apply the formatting after grouping.
After grouping rows, you should not change the column count and row count. The **GroupDataModel** does not support changing the column or row count.
To add or remove columns or rows, you need to call the original data model methods. You can access the original data model using the [TargetModel](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Model.GroupDataModel.TargetModel.html) property of the [GroupDataModel](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Model.GroupDataModel.html) class. The type of **TargetModel** property varies depending on the level of grouping. Therefore, you can fetch the level of the **TargetModel** property at which it becomes of the **DefaultSheetModel** type.
The following example code demonstrates how to use the TargetModel property in a GroupDataModel.

```csharp
GroupDataModel groupDataModel = new GroupDataModel(fpSpread1_Sheet1.Models.Data);
while (groupDataModel.TargetModel is GroupDataModel)
{
  groupDataModel = (groupDataModel.TargetModel as GroupDataModel);
}
if(groupDataModel.TargetModel is DefaultSheetDataModel defaultSheetDataModel)
{
  // Perform your desired row or column updates
}
```

```vbnet
Dim groupDataModel As GroupDataModel = New GroupDataModel(fpSpread1_Sheet1.Models.Data)
While TypeOf groupDataModel.TargetModel Is GroupDataModel
   groupDataModel = TryCast(groupDataModel.TargetModel, GroupDataModel)
End While
Dim defaultSheetDataModel As DefaultSheetDataModel = Nothing
If CSharpImpl.__Assign(defaultSheetDataModel, TryCast(groupDataModel.TargetModel, DefaultSheetDataModel)) IsNot Nothing Then
   ' Perform your desired row or column updates
End If
```

The following features can work with grouping or are not affected by grouping:

* Grouping and hidden columns work together.
* The grouping feature affects only the visual display. Such things as export and printing are not affected.
* Grouping and input maps or action maps work together.

## Features That Do Not Interoperate with Grouping

These features do not interoperate with grouping in Spread.

| **Feature** | **Description** |
| ------- | ----------- |
| Alternating Rows | Grouping and alternating rows do not work together. Grouping changes the order of the rows, so having a display of alternating rows would not make sense. Thus, these features do not work together. |
| Clipboard Paste | Pasting does not work with grouping. |
| Conditional Formatting | Grouping and conditional formatting do not work together. Conditional formatting requires the default data model. Thus, these features do not work together. |
| Filtering | Grouping and filtering do not work together. If you want to use grouping, you should not use filtering and you should clear the filter under the [Grouping](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Grouping.html) event. |
| Formulas | Grouping and formulas do not work together. Formulas requires the default data model. Thus, these features do not work with grouping. |
| Outlines | Grouping (Outlook style) and outlines (range groups) are not intended to work together. |
| Sorting | Grouping and sorting do not work together. Grouping is a type of sorting. When grouping is on, clicking on column headers will cause grouping not sorting. Thus, these features do not work together. |
| Hierarchical Data Display | Grouping and hierarchical display do not work together. |
| Error icons | Error icons do not work with grouping. |

## See Also

[Allowing the User to Group Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping/spwin-group-allowuser)
[Using Grouping](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping/spwin-group-using)
[Setting the Appearance of Grouped Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping/spwin-group-appear)
[Customizing the Group Bar](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping/spwin-group-barcustom)
[Creating a Custom Group](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping/spwin-group-model)