windowsforms-devexpress-dot-xtraspreadsheet-dot-spreadsheetcontrol-0cd05862.md
Fires before the expand/collapse operation is executed for row or column groups in a worksheet.
Namespace : DevExpress.XtraSpreadsheet
Assembly : DevExpress.XtraSpreadsheet.v25.2.dll
NuGet Package : DevExpress.Win.Spreadsheet
public event BeforeGroupProcessingEventHandler BeforeGroupProcessing
Public Event BeforeGroupProcessing As BeforeGroupProcessingEventHandler
The BeforeGroupProcessing event's data class is BeforeGroupProcessingEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Cancel | Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs. |
| IsRowGroup | Indicates whether the event is raised for row groups. |
The WinForms Spreadsheet control ships with a set of events that allow you to control the expand/collapse operations for row and column groups in a worksheet.
The following events occur when a user clicks a plus / minus symbol on the outline bar (or the Hide Detail / Show Detail button on the Data ribbon tab):
BeforeGroupProcessingThe following events occur when a user clicks one of the outline buttons to expand/collapse row or column groups:
BeforeGroupProcessingThe BeforeGroupProcessing event fires before the expand/collapse operation starts. Enable the Cancel property of the event data class to cancel the operation. The IsRowGroup property allows you to check the type of affected groups (row or column).
The following code snippet demonstrates how to prevent the expand/collapse operations for row groups in a worksheet:
spreadsheetControl1.BeforeGroupProcessing += (s, e) => {
if (e.IsRowGroup)
e.Cancel = true;
};
AddHandler spreadsheetControl1.BeforeGroupProcessing,
Sub(s, e)
If e.IsRowGroup Then
e.Cancel = True
End If
End Sub
See Also