Data Sorting and Grouping
When sorting and/or grouping data, you can include as many columns as your business needs dictate.
 
Table View
|
Both sorting and grouping can be done programmatically or via the DXGrid runtime UI. End-user options/features are as follows:
- Click column headers to sort data against the corresponding field or to reverse sort order.
- Right-click a column header and select sort order from the context menu.
- Click column headers holding SHIFT or CTRL pressed to sort against multiple columns.
- Drag a column header to the group panel to group data against the column.
- Drag column headers within the group panel to change nesting order.
- Drag a column header back to the column header panel to cancel data grouping against the column.
- Right-click the Group Panel to view the data grouping menu in order to expand or collapse all grouped rows.
- Right-click a column header and use its context menu to group or ungroup data against the column's values.
Advanced Data Sorting and Grouping Options
By default, data sorting and grouping algorithms simply compare database values from the appropriate data field. Depending on your data, you may need to change these default algorithms to provide a more robust data analysis UI. For instance, instead of grouping by unique dates you may need to group data by years. If you are sorting alpha-numeric values, you may need to change the default string comparison mechanism. 
To address this and other sorting and/or grouping requirements, you can implement one of the following DevExpress Silverlight Grid features:
- Predefined Group Intervals - using this feature, you can change how the grid groups date/time, string and numeric values. Date/time values can be grouped by months, years or using Outlook style grouping. Text values can be grouped alphabetically, based on their first character. Finally, you can provide custom intervals for numeric value grouping.
- Sort and Group by Display Text - if cell text differs from underlying field values, you may wish to enable sorting and grouping by display text to make the application more usable. This is extremely useful when displaying lookup data, so that rows are sorted by values users see on screen and not by underlying IDs. Note that by handling a special event, you can easily provide custom display text for data cells.
- Sort and Group Data Manually - you can take full control over data sorting and grouping by writing your own value comparison handler thus defining row order and which rows should be placed within the same data group.
|