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 and Dynamic DataSource

Hello. I am having an issue with dynamically changing the DataSource (all of my DataSource objects are strongly-typed custom object collections) on my GridGroupingControl. If I simply leave the TableDescriptor columns unmodified, I can null out the DataSource columns, reset the TableDescriptor and attach the new DataSource (as displayed in the Syncfusion\Essential Studio\x.x.x.xx\Windows\Grid.Grouping.Windows\Samples\GridGroupingRebind) and everything behaves as expected.

The problems occur, however, when I programmatically manipulate the columns that I want to display in the grid, based on my changing DataSource. The initial process of "define columns, bind DataSource" works as expected, but subsequent iterations generate an issue. After the first change of the DataSource, the grid no longer displays anything - columns, data, etc. There are no errors being generated (as near as I can tell), and the databinding is successful, because I can see the vertical scroll bar appearing and disappearing as I set DataSources with varying numbers of records. The steps as defined in the Syncfusion sample, though, do not resolve my issue as I would like.

I have tried defining my columns before AND after the binding of the DataSource, with the same results: an empty white box where the grid should be.

What is causing this issue, and what can I do to resolve it?

2 Replies

AD Administrator Syncfusion Team December 1, 2006 01:08 PM UTC

Hi John,

Before you set the datasource for the grid, you need to clear the columns and unbound columns using the Clear() method and then add the columns. Please refer to the attached sample for implementation.

Sample : GGC_ResetDataSource.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team December 1, 2006 02:56 PM UTC

Hi Haneef,

My problem has been solved. Thanks for your assistance!

>Hi John,

Before you set the datasource for the grid, you need to clear the columns and unbound columns using the Clear() method and then add the columns. Please refer to the attached sample for implementation.

Sample : GGC_ResetDataSource.zip

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon