This topic gives an overview of the xamDataGrid™ control’s grouping functionality allowing users to group data into more readable and navigable arrangements.
The following topic is a prerequisite to understanding this topic:
This topic contains the following sections:
Grouping, the ability to present related data together is one of the xamDataGrid important functionalities that the user can perform using either the UI or code.
Grouping also allows users to drag field headers from multiple field layouts into the group-by area.
There is a second option, which displays a button for each field in the default layout underneath the group-by area. Users can drag these buttons into the group-by area to group records in the default field layout; however, this option does not allow users to group records using fields in multiple field layouts. This option is backward compatible with previous releases.
The xamDataGrid is highly user configurable using these settings.
You can set this GroupByArea
property to a control of type GroupByArea to attach an external group-by area to the DataPresenter or to modify properties of the GroupByArea
control. This group-by area only allows grouping by fields in the default field layout.
This property serves three separate purposes.
Primary purpose is to determine whether users can group records using fields from multiple field layouts. For example, if you have a nested hierarchy of Customer and Order data items, this property determines if users can group the Customer data items and the Order data items.
Secondary purpose is to determine how much space the group-by area will occupy when you enable multiple field layout grouping. If you use the MultipleFieldLayoutCompact
setting, the control displays the group-by criteria, in a single line, in the group-by area. However, with the MultipleFiledLayoutsFull sett``ing
, the xamDataGrid will display each unique field layout on a separate line in the group-by area.
Tertiary purpose is to switch between the two different UI options available for grouping records. If you enable grouping only on the default field layout and prefer the older grouping UI, that is to say use the DefaultFieldLayoutOnly
, the group-by area will display buttons for the fields in the default field layout. Otherwise, users will be able to drag field headers from multiple field layouts into the group-by area.
You can set this property to a GroupByAreaMulti
control to attach an external group-by area to the DataPresenter
or to modify properties of the GroupByAreaMulti
control.
This property allows you to set the location of the group-by area.
You can provide your own sorting logic for group-by records by setting this property to an object that implements the IComparer interface.
The GroupByEvaluationMode
enumeration has the following members:
This property can be set to a custom implementation of the IGroupByEvaluator interface. This interface has a read-only SortComparer
property of the IComparer type. The IGroupByEvaluator
interface’s SortComparer
property should return a comparer that is logically consistent with the implementation of its DoesGroupContainRecord method.
In other words, the sort order logic is consistent with the grouping logic, and all DataRecord`s that end up in the same group should return zero from the comparer’s Compare method when being compared with another `DataRecord
from the same group.
The GroupByMode
property gets or sets a FieldGroupByMode enumeration. The property allows you to specify which of default GroupByEvaluators
to use when grouping a field.
Unless set, this property reverts to its default value to one of the following options, based on EditAsType property of the FieldSettings
class.
The following topics provide additional information related to this topic.