'Declaration Public Property GroupDescriptions As IList(Of GroupDescription)
public IList<GroupDescription> GroupDescriptions {get; set;}
'Declaration Public Property GroupDescriptions As IList(Of GroupDescription)
public IList<GroupDescription> GroupDescriptions {get; set;}
The C1.Win.C1FlexGrid.C1FlexGridBase.GroupDescriptions property is similar to the C1.Win.C1FlexGrid.C1FlexGridBase.GroupDescriptions property available in the XAML and JavaScript versions of the FlexGrid.
Each group description also specifies a sort direction for the property. For example, if you group the data by Country, the grid will sort the data by country before creating the groups.
Grouping works best when the C1.Win.C1FlexGrid.C1FlexGridBase.DataSource can be sorted by multiple properties (System.ComponentModel.IBindingListView). This is the case for System.Data.DataTable sources. If you want to group lists of arbitrary objects, use the C1.Win.C1FlexGrid.SortableBindingList<T> class.
For example:
var list = new List<MyDataObject>(); for (var i = 0; i < 100; i++) { list.Add(new MyDataObject(i)); } grid.DataSource = new SortableBindingList<MyDataObject>(list); grid.GroupDescriptions = new List<GroupDescription>() { new GroupDescription("Country"), new GroupDescription("Product"), };
The C1.Win.C1FlexGrid.C1FlexGridBase.GroupDescriptions property uses the grid's C1.Win.C1FlexGrid.C1FlexGridBase.Subtotal method to create and update the groups when the data is modified.