The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team March 10, 2005 03:14 PM UTC
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
SRSigurd RingbakkenMarch 10, 2005 08:58 PM UTC
>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