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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Refresh grid content after changing datasource

Thread ID:





62003 Jun 6,2007 08:02 AM UTC Jun 7,2007 09:09 AM UTC WinForms 4
Tags: GridControl
Mårten Lind
Asked On June 6, 2007 08:02 AM UTC

I'm changing the datasource for a gridgroupingcontrol in the following way:

m_BindingSource.DataSource = newDataSource;
m_GridControl.DataSource = m_BindingSource;

newDataSource contains a data table with a different column setup compared to the previous data table bound to the grid.

My problem is that I can't make the grid reload the values with the new data source correctly. The columns all show up OK but the content (cell values) is not correct.

I'm using stacked row headers and expression fields in the grid, and before rebuilding these (after changing the datasource) I do the following:
gridTableDescriptor.Columns.Reset(); gridTableDescriptor.ResetExpressionFields();

VS.NET 2005

What is the correct way of reloading data in the GGC after changing datasource to a new data table with a different column setup?

Any suggestions greatly appreciated.


haneefm [Syncfusion]
Replied On June 6, 2007 06:04 PM UTC

Hi Marten,

You can try this code snippets to reset the datasource for the grid and see if it helps.

this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.DataMember = null;
this.gridGroupingControl1.DataSource = newdatasource;

Please refer the GridGroupingRebind sample in the browser samples shipped with the product.
[instal path]\Syncfusion\Essential Studio\\windows\Grid.Grouping.Windows\Samples\FeatureSamples\GridGroupingRebind

This sample demonstrates the switching of datasources at runtime and how to reset the GridGroupingControl to its original empty state.

Best regards,

Mårten Lind
Replied On June 6, 2007 08:03 PM UTC

Thanks Haneef,

Now it's working as expected.

Couldn't find the GridGroupingRebind sample for my GGC version ( Any idea where I can find the sample you're refering too?


haneefm [Syncfusion]
Replied On June 6, 2007 08:57 PM UTC

Hi Marten,

Please find the attached sample below and let me know if this helps.

Best regards,

Mårten Lind
Replied On June 7, 2007 09:09 AM UTC

Hi again,

Thanks for the sample. My problem was solved when calling gridGroupingControl1.ResetTableDescriptor();

Thanks for a quick answer,



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon