I have a GridGroupingControl where the datasource is bound to a table in a dataset.
If I change the datasource to another table, the grid still displays the previous table''s columns and they are all empty!
How do I change the datasource to another table such that the grid shows the data from the new table correctly?
TIA
AD
Administrator
Syncfusion Team
August 30, 2004 07:56 PM UTC
Try this code:
gridGroupingControl1.DataSource = null
gridGroupingControl1.DataMember = null
gridGroupingControl1.ResetTableDescriptor()
gridGroupingControl1.DataSource = newDataTable
gridGroupingControl1.TableDescriptor.SetItemProperties(gridGroupingControl1.Engine.GetSouceList())
gridGroupingControl1.Table.TableDirty = True
gridGroupingControl1.Table.SummariesDirty = True
gridGroupingControl1..Refresh()
AD
Administrator
Syncfusion Team
August 31, 2004 09:52 AM UTC
With the latest version (2.1.0.9 and later), the only call that should be necessary is ResetTableDescriptor().
SR
Shankar Ramasubramanian
March 14, 2005 03:23 PM UTC
Clay,
I tried the exact same code that you posted. It didn''t work. When I bind the datasource for the very first time,every thing is okay. The next time nested table is empty and the thrid time the top level table is empty. Syncfusion 2.0.5.1
AD
Administrator
Syncfusion Team
March 14, 2005 04:54 PM UTC
You should probably upgrade. In 3.0, we ship a sample, \Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\Grouping\GridGroupingRebind, that shows rebinding working.
When using nested tables, you also should call this.gridGroupingControl1.TableDescriptor.Relations.Reset();
SR
Shankar Ramasubramanian
March 14, 2005 07:39 PM UTC
gridGroupingControl1.TableDescriptor.Relations.Reset(); I don''t see that method. I tried to
gridGroupingControl1.TableDescriptor.Relations.RemoveAt(0) and this didn''t work either. Is there anyway to make it work in 2.0.5.1. I would like to use upgrade to 3.0 as last option. Thanks
shankar
SR
Shankar Ramasubramanian
March 14, 2005 07:59 PM UTC
I tried gridRequests.TableDescriptor.ResetRelations(). This didn''t work either
AD
Administrator
Syncfusion Team
March 14, 2005 08:08 PM UTC
Try
gridGroupingControl1.TableDescriptor.Relations.Clear()
.
It will be later tomorrow before I have access to 2051.
SR
Shankar Ramasubramanian
March 14, 2005 08:58 PM UTC
Clay,
gridGroupingControl1.TableDescriptor.Relations.Clear() did not work either. I got runtime error argument out of range. childtabledescriptor.
m_childTableDescriptor = gridRequests.TableDescriptor.Relations(0).ChildTableDescriptor
This line appears after i relations.clear and bind the datasource.
Any help would be greatly appreciated
AD
Administrator
Syncfusion Team
March 15, 2005 10:44 AM UTC
The only way I would know to get this reliably donne in 2.0.5.1 is to dispose and recreate the gridgroupingcontrol.
http://www.syncfusion.com/Support/user/uploads/ResetData2051_e6ae9f92.zip
If you update to the current release, you could avoid this.