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.
Unfortunately, activation email could not send to your email. Please try again.

GGC: Calling CreateGroup

Thread ID:

Created:

Updated:

Platform:

Replies:

25946 Mar 10,2005 08:32 AM Mar 10,2005 03:58 PM Windows Forms 2
loading
Tags: GridControl
Sigurd Ringbakken
Asked On March 10, 2005 08:32 AM

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

Administrator [Syncfusion]
Replied On 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

Sigurd Ringbakken
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;