Skip to main content

GridView.CanGroupColumn(GridColumn) Method

Indicates whether end-users can group data by a column’s values.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

public override bool CanGroupColumn(
    GridColumn column
)

Parameters

Name Type Description
column GridColumn

A GridColumn object (or descendant) that represents the tested column.

Returns

Type Description
Boolean

true end-users can involve the specified column in data grouping; otherwise, false.

Remarks

This member supports the grid control’s internal infrastructure and is not intended to be used in your code.

The CanGroupColumn method returns true if the following conditions are met:

  • The View can be sorted by values of the specified column. This depends on the column’s data type, View settings and column settings.
  • View and column settings allow end-users to group data by values of the specified column.

There are a number of ways to control sorting and grouping features available to end-users. The main properties affecting this are the View’s GridView.OptionsCustomization and the column’s GridColumn.OptionsColumn properties. Please refer to the Sorting in Code and Grouping topic for additional information.

Views use the CanGroupColumn method to determine whether the specified column’s header can be dragged and dropped onto the column header panel and whether the column header context menu enables the grouping of data by values of the specified column.

Important note: the actual grouping availability may not match the CanGroupColumn method’s return value. For instance, you may handle the GridView.DragObjectStart and GridView.DragObjectOver events to customize the column header dragging behavior. Additionally, you can handle the GridView.PopupMenuShowing event to customize the column header context menu.

See Also