ShowItemsInGroups Property
Description
Specifies whether the GridRecordItems will be automatically shown in groups when a column is sorted.
Property Type
Read-write property
Syntax (Visual Basic)
Public Property ShowItemsInGroups() As Boolean
Remarks
If True, when a column header is clicked on to be sorted, that column is automatically added to the Group By box and the rows are grouped by that header. Rows can only be automatically grouped by one column at a time; when another column header is clicked, the rows are then grouped by that column.
You can also use the GridControl's SortOrder to determine how the rows/records will be grouped. The records/rows in the GridControl will automatically be grouped by the first column that was added to the GridControl's SortOrder. If no columns were added to the GridControl's SortOrder, then the rows/records will not be grouped.
After the rows/records are grouped, they are sorted according to their SortPriority.
Example
ShowItemsInGroups Sample (Visual Basic) - This sample illustrates how to use the ShowItemsInGroups property.
' This code below will add three columns to the SortOrder collection of columns.
' This will cause the columns in the GridControl to first be sorted by column 7,
' which has an index of zero (0) in the SortOrder collection. Columns are first sorted
' in the order that they are added to the SortOrder collection.
wndGridControl.SortOrder.Add wndGridControl.Columns(7)
wndGridControl.SortOrder.Add wndGridControl.Columns(2)
wndGridControl.SortOrder.Add wndGridControl.Columns(5)
' This will cause the column at index 0 of the SortOrder collection to be sorted
' in descending order.
wndGridControl.SortOrder(1).SortAscending = False
' This will cause the rows/records to be grouped according to the column arrangement
' in the GridControl's SortOrder column collection.
' In this sample, the rows/records will first be grouped by column 7, then by column 2
' in descending order, and last by column 5.
wndGridControl.ShowItemsInGroups = True
See Also
- TrackControl Control
- SortPriority Property
- GroupPriority Property
- GroupCaption Property
- ShowGroupBox Property
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.