ComponentOne FlexGrid for WinForms
GroupDescription Class
Members  Example 

C1.Win.C1FlexGrid Namespace : GroupDescription Class
Describes the grouping of items using a property name as the criterion. 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.
Public Class GroupDescription 
public class GroupDescription 
private void Form1_Load(object sender, EventArgs e)
            _flex = new C1FlexGrid();
            _flex.Bounds = new System.Drawing.Rectangle(20, 80, 750, 550);
            OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;Data Source=" + Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\ComponentOne Samples\\Common\\C1NWind.mdb");
            DataTable ordersTable = new DataTable();
            new OleDbDataAdapter("Select * from Orders", con).Fill(ordersTable);
            _flex.DataSource = ordersTable;

            for (int column = _flex.Cols.Fixed; column < _flex.Cols.Count; column++)
            grpByCombo.SelectedIndexChanged += GrpByCombo_SelectedIndexChanged;
            grpByCombo.SelectedItem = "ShipCountry";

            //Hide the grouped column (Optional)
            _flex.HideGroupedColumns = true;

private void GrpByCombo_SelectedIndexChanged(object sender, EventArgs e)
            //setting the grid's GroupDescription property
            _flex.GroupDescriptions = new GroupDescription[] { new GroupDescription(grpByCombo.SelectedItem.ToString(),System.ComponentModel.ListSortDirection.Ascending, true) };
Inheritance Hierarchy


See Also


GroupDescription Members
C1.Win.C1FlexGrid Namespace