We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridGroupingControl

I''m looking for an example of how to programatically build/populate a GridGroupingControl without setting a datasource on the control (it need not be databound...will be view-only). I need the set of groups to always appear regardless if they actually exist in my data without having to kludge the actual data. Thus I''d like to add the grouping rows and child rows myself. I''m just looking for a simple example of one group level with a set of child rows.

2 Replies

AD Administrator Syncfusion Team October 21, 2004 12:05 AM

You will have to build a IList object to hold your data through some kind of custom collection. The data does not have to come from a database in order for a GridGroupingControl to work with it, but it must be an an object that implements IList. If the items in the collection are not strongly typed, then the list should also implement ITypeList. Once you have this IList, ITypedList object, you would set it as the datasource of the groupingcontrol or (use gridGroupingControl1.Engine.SetSourceList to set it). If you really have arbitray untyped objects you are working with, here is a of how you can dynamically add properties at runtime to your IList by implementing ITypedList. This little sample dynamically adds properties at runtime to an arraylist dataobject. It does so by passing the list of types and a list of names for the properties it wants the objects in the arraylist to have.


DB Dewitt Blankenship October 21, 2004 09:03 AM

Thanks for the reply. Ok, so am I reading correctly that it is not possible to build a GridGroupingControl manually without setting a datasource? We do this extensively with the GridControl, was just hoping there was a way to do it likewise with the GridGroupingControl.

Loader.
Live Chat Icon For mobile
Up arrow icon