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

GGC: Calling CreateGroup

Hi! I''m trying to call the CreateGroup-method on a GridGroupingControl.TableDescriptor, but I get an invalid cast exception. I create a new SortColumnDescriptorCollection, adds two columns and calls the CreateGroup method. Any suggestions? Code: SortColumnDescriptorCollection col = new SortColumnDescriptorCollection(); col.Add( col1 ); col.Add( col2 ); leftGroupCtrl.TableDescriptor.CreateGroup( leftGroupCtrl.Table.TopLevelGroup.Sections[4], true, leftGroupCtrl.Table, col ); Regards, Sigurd Ringbakken

2 Replies

AD Administrator Syncfusion Team March 10, 2005 10:14 AM

Hi Sigurd, Probably leftGroupCtrl.Table.TopLevelGroup.Sections[4] is not a RecordsDetailsSection. Then you will get a invalid cast sinc you also specify hasRecords = true. There is probably also a problem with passing in a section from another group as a reference. You can''t have multiple groups reference the same section. What''s the reason behind manually creating groups? These methods are meant to be called from the engine when it is categorizing elements. There are no methods in the engine that will allow you to manually hook up/add that method to the table ... Stefan >Hi! I''m trying to call the CreateGroup-method on a GridGroupingControl.TableDescriptor, but I get an invalid cast exception. > >I create a new SortColumnDescriptorCollection, adds two columns and calls the CreateGroup method. > >Any suggestions? > >Code: > SortColumnDescriptorCollection col = new SortColumnDescriptorCollection(); > col.Add( col1 ); > col.Add( col2 ); > > leftGroupCtrl.TableDescriptor.CreateGroup( leftGroupCtrl.Table.TopLevelGroup.Sections[4], true, leftGroupCtrl.Table, col ); > >Regards, >Sigurd Ringbakken


SR Sigurd Ringbakken March 10, 2005 03:58 PM

>What''s the reason behind manually creating groups? These methods are meant to be called from the engine when it is categorizing elements. There are no methods in the engine that will allow you to manually hook up/add that method to the table ... I was actually experimenting a bit, trying to group by two columns. (http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=25820) Since the GridTableDescriptor inherits the Grouping.TableDescriptor, I thought I could use the methods in the base class. Regards, Sigurd Ringbakken

Loader.
Live Chat Icon For mobile
Up arrow icon