Generic Collection Demo

This sample demonstrates the implementation of a generic collection and how you can bind it to a Grid Grouping control.

Features:

The following code demonstrates binding to a BindingList component containing a CustomClass object. The code can be used to create a binding list.

                BindingList<T> bl = new BindingList<T> ();  

"T" is a placeholder that will accept the type of the custom collection class.

Here is sample code that creates a binding list with a custom-class object.

                BindingList<CustomClass> bl = new BindingList<CustomClass>();  

New custom-class objects are added to the binding list.

                bl.Add(new CustomClass(0101, "Charlotte", "Cooper", "49 Gilbert St.", "London"));
                bl.Add(new CustomClass(0102, "Shelley", "Burke", "P.O. Box 78934", "New Orleans"));
                bl.Add(new CustomClass(0103, "Regina", "Murphy", "707 Oxford Rd.", "Ann Arbor"));
                bl.Add(new CustomClass(0104, "Yoshi", "Nagase", "9-8 Sekimai Musashino-shi", "Tokyo"));  

The binding list that has been created with the custom-class object is bound to the Grid Grouping control.

                gridGroupingControl1.DataSource = bl;  

GenericCollection screenshot