Skip to main content

GridOptionsCustomization.AllowGroup Property

Gets or sets a value specifying whether end-users can apply data grouping.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool AllowGroup { get; set; }

Property Value

Type Default Description
Boolean true

true if end-users can apply data grouping; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AllowGroup
GridView
.OptionsCustomization .AllowGroup

Remarks

End-users can apply data grouping in two ways. First by dragging a column header to the group panel. The second way is to right-click a column header and choose the context menu’s Group By This Field item. Both these methods are allowed when the AllowGroup property value is true. Otherwise, column headers cannot be dragged to the group panel and the menu item is disabled.

When the AllowGroup option is enabled, you can specify which individual columns can be dragged to the group panel. Use the desired columns’ GridColumn.OptionsColumn property for this purpose. Additionally, you can handle the GridView.DragObjectStart and GridView.DragObjectOver events for total control over column header dragging.

The column header context menu can be prohibited using the View’s GridOptionsMenu.EnableColumnMenu option. Note that you can also handle the GridView.PopupMenuShowing and GridView.GridMenuItemClick events for more control over the context menu’s availability and actions performed when clicking menu items.

Important note: data grouping requires data sorting to be performed. Thus, end-users can group data only when the View’s GridOptionsCustomization.AllowSort and the desired columns’ OptionsColumn.AllowSort options are enabled.

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

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