GridColumn.GroupInterval Property
Gets or sets how data rows are grouped when grouping by the current column is applied. Certain limitations apply in server mode.
Namespace: DevExpress.XtraGrid.Columns
Assembly: DevExpress.XtraGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
Declaration
[DefaultValue(ColumnGroupInterval.Default)]
[DXCategory("Data")]
[XtraSerializableProperty]
[XtraSerializablePropertyId(2)]
public ColumnGroupInterval GroupInterval { get; set; }
Property Value
Type | Default | Description |
---|---|---|
ColumnGroupInterval | Default | A ColumnGroupInterval value that determines how data rows are grouped when grouping by the current column is applied. |
Available values:
Name | Description |
---|---|
Default | For columns which store date/time values, this option is the same as the ColumnGroupInterval.Date option. For non date/time columns this option is the same as the ColumnGroupInterval.Value option. |
Value | Rows are grouped by values of grouping columns. The number of groups matches the number of unique values within the grouping column. For date/time columns, both the date and time portions are taken into account for value comparison. To specify how date/time values are presented in group rows in WinForms Data Grid, apply formatting to the grouping column (e.g., with the GridColumn.DisplayFormat property). |
Date | This option is in effect only for columns that store date/time values. Rows are grouped by the date part of their values, the time portion is ignored in this grouping mode. |
DateMonth | This option is in effect only for columns that store date/time values. Rows are grouped by the month part of their values. |
DateYear | This option is in effect only for columns that store date/time values. Rows are grouped by the year part of their values. |
DateRange | This option is in effect for columns that store date/time values. Rows are combined into the following non-overlapping groups according to their date value as compared with today’s date: “Beyond Next Month”, “Next Month”, “Later this Month”, “Three Weeks Away”, “Two Weeks Away”, “Next Week”, “Today”, “Tomorrow”, “Yesterday”, “Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Last Week”, “Two Weeks Ago”, “Three Weeks Ago”, “Earlier this Month”, “Last Month”, “Older”. |
Alphabetical | Rows are grouped by the character that grouping column values start with. Note Not supported in server mode for numeric and date/time columns. |
DisplayText | Rows are grouped by display values of the grouping column. In specific instances, column cells can have different edit values, but the same display value. To combine these rows into the same group, use the DisplayText group mode. Note Not supported in server mode. |
Remarks
When data is grouped by a specific column, the View’s rows are combined into groups. By default, each group contains rows which have the same value in the field (column) for which grouping has been applied. Use the GroupInterval property to change the logic used to decide which rows should be grouped together. For instance, for a column that displays date/time information, you can set its GroupInterval property to ColumnGroupInterval.DateYear. In this case, when grouping is applied against this column, the data rows will be combined into groups according to the year part of their values. See the ColumnGroupInterval topic, for information on the other options.
The order in which group rows are arranged is specified by the GridColumn.SortOrder and GridColumn.SortMode properties.
To provide custom grouping logic when data is grouped by a specific column, set the column’s GridColumn.SortMode property to ColumnSortMode.Custom, and handle the GridView.CustomColumnGroup event.
See Working with Groups in Code for an overview of group modes.
Group rows can be painted in the standard manner or using the Office2003 paint style. To specify how group rows should be painted, use the GridOptionsView.GroupDrawMode property.
An end-user can change the group interval for date-time columns at runtime via a context menu if the GridOptionsMenu.ShowDateTimeGroupIntervalItems option is enabled.
Note
The GroupInterval property is not supported in server mode when binding with the WcfServerModeSource and WcfInstantFeedbackSource. For limitations on using other server mode data sources, see ColumnGroupInterval and Large Data Sources: Server and Instant Feedback Modes.