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
close icon

Re-binding grid doesn''t display data for extra columns

Hi,
In my win from application I am using Syncfusion grid for dynamicaly binding to different datasources depending upond some business need. However number of columns are different in each data source. Also for each type of data source I am saving the columns order to .egt file and retrieving it when I am binding specific type of data source. However if i have two datasources say ds1 & ds2 and if I bind ds1 (with 10 columns) and then ds2 (with 8 columns) and again ds1 then grid is showing data for only 8 columns (even though it is expected to show data in 10 columns) and it is not showing any data & header text for last two columns. It just displays blank column. Please note that I am loading column order every time I am binding the data source.
I will appreciate your help on this.
Thanks,
Kishor


1 Reply

AD Administrator Syncfusion Team March 4, 2008 05:52 PM UTC

Hi Kishor,

Thank you for your interest in Syncfusion Products.

To rebind the datasource of the GridGrouping control, we need to reset the TableDescriptor and also datasource should be set to null. The following code snippet illustrates this:

this.gridGroupingControl1.SuspendLayout();
this.gridGroupingControl1.ResetTableDescriptor();
this.gridGroupingControl1.TableDescriptor.Relations.Reset();
this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.DataMember = null;
this.gridGroupingControl1.DataSource = newdatasource;
this.gridGroupingControl1.ResumeLayout(true);

Please find the simple sample in the following link:
http://websamples.syncfusion.com/samples/Grid.Windows/F71892/main.htm

Please let me if this helps.

Regards,
Srirajan



Loader.
Live Chat Icon For mobile
Up arrow icon