Skip to main content
A newer version of this page is available. .

GridView.GroupRowCollapsing Event

Occurs before group rows are collapsed.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v19.1.dll

Declaration

[DXCategory("Behavior")]
public event RowAllowEventHandler GroupRowCollapsing

Event Data

The GroupRowCollapsing event's data class is RowAllowEventArgs. The following properties provide information specific to this event:

Property Description
Allow Gets or sets a value specifying whether the current operation is allowed.
RowHandle Gets the row’s handle (position). For the ColumnView.RowUpdated event, this property specifies the previous handle (position) of the currently processed row. Inherited from RowEventArgs.

Remarks

The GroupRowCollapsing event is raised when an attempt to collapse a group row is made. Note that it doesn’t matter whether this is done by end-users or via code. The row is identified by the RowEventArgs.RowHandle parameter. To prevent the row from being collapsed set the RowAllowEventArgs.Allow parameter to false.

Group rows can be collapsed recursively via the GridView.SetRowExpanded method overload with the recursive parameter set to true. In this case, the GroupRowCollapsing event is raised only once (for the row which is passed as this method’s parameter). For nesting rows, this event is not raised.

This event is also called when all group rows are collapsed at the same time (via a group panel context menu or GridView.CollapseAllGroups method). In this case, the RowEventArgs.RowHandle parameter is set to GridControl.InvalidRowHandle.

Please refer to the Working with Groups in Code topic for additional information.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupRowCollapsing event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also