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

GGC table order and rebinding

I have a couple of questions/issues with the GCC

1) If I'm using a table/child hierarchical structure of business objects (data source is a BindingList which contains two child BindingLists), how can I control which child appears first in the drop down hierarchy?

2) I'm having a very hard time "refreshing" the grid after clearing and reloading the BindingList that is the DataSource. I've tried the "rebinding" type methods with about 80% success but there always seems to be painting problems afterwards. In my case, the columns in one of the child tables aren't big enough to show the full text. Here's the code from my ReBind method:

GridTableDescriptor outcomesDescriptor = GetTableDescriptor("Outcomes");
outcomesDescriptor.ResetColumns();
outcomesDescriptor.Reset();

GridTableDescriptor conditionsDescriptor = GetTableDescriptor("Conditions");
conditionsDescriptor.ResetColumns();
conditionsDescriptor.Reset();

ResetChildGroupOptions();
ResetTableDescriptor();
rules.Clear(); // the sata source, bindinglist
DataSource = null;
DataMember = null;
LoadRules();
BindGrid();



2 Replies

MA Mark Atkinson January 21, 2008 11:12 PM UTC

Can anyone help me with the first issue below?
If I'm using a table/child hierarchical structure of business objects (data source is a BindingList which contains two child BindingLists), how can I control which child appears first in the drop down hierarchy?


>I have a couple of questions/issues with the GCC

1) If I'm using a table/child hierarchical structure of business objects (data source is a BindingList which contains two child BindingLists), how can I control which child appears first in the drop down hierarchy?

2) I'm having a very hard time "refreshing" the grid after clearing and reloading the BindingList that is the DataSource. I've tried the "rebinding" type methods with about 80% success but there always seems to be painting problems afterwards. In my case, the columns in one of the child tables aren't big enough to show the full text. Here's the code from my ReBind method:

GridTableDescriptor outcomesDescriptor = GetTableDescriptor("Outcomes");
outcomesDescriptor.ResetColumns();
outcomesDescriptor.Reset();

GridTableDescriptor conditionsDescriptor = GetTableDescriptor("Conditions");
conditionsDescriptor.ResetColumns();
conditionsDescriptor.Reset();

ResetChildGroupOptions();
ResetTableDescriptor();
rules.Clear(); // the sata source, bindinglist
DataSource = null;
DataMember = null;
LoadRules();
BindGrid();






HA haneefm Syncfusion Team January 23, 2008 11:47 PM UTC

Hi Mark,

You can change order of the childtable by using the Relations collection in a GridTableDescriptor. Below are the codes:

int iRelationCount = this.gridGroupingControl1.TableDescriptor.Relations.Count;
GridRelationDescriptor[] rds = new GridRelationDescriptor[iRelationCount];
this.gridGroupingControl1.TableDescriptor.Relations.CopyTo( rds,0);
this.gridGroupingControl1.TableDescriptor.Relations.Clear();
for(int i = iRelationCount -1;i>=0;i--)
this.gridGroupingControl1.TableDescriptor.Relations.Add(rds[i]);
this.gridGroupingControl1.Reinitialize();

Best regards,
Haneef


Loader.
Live Chat Icon For mobile
Up arrow icon