Hi
i'm having a strange issue with my wingrid binding.
I have my wingrid bound to a heirarchical dataset which views fine.
i have a button that adds a summary table to the dataset (and child relation to the underlying table in the dataset). the wingrid is then bound to the summary table instead and this also works fine (can drill down into the data etc.)
clicking the button binds the wingrid to the original datatable and deletes the summary table (and relation) from the dataset.
trying to get the summary table to reshow by clicking the button again (and executing the same code) causes a problem in that the wingrid is being bound to the summary table but it is not seeing the child relations. I can see that they are present in the dataset (in the immediate window)..but for soem reason its not being boudn properly
can anyone offer any advice as to what i am doing wrong...i've tried everything!
regards
Hello,
Our developers have researched this issue and have determined that the issue is not with our controls. It looks like either the BindingManager or the DataSet are doing some sort of caching here and it's getting screwed up when you remove a table and a relationship and then add them back in with the same names.
You can verify this by adding the following code to the bottom of the button1_Click method in the sample.
BindingManagerBase bm = this.BindingContext[dataSet1, "Summary"]; PropertyDescriptorCollection pdc = bm.GetItemProperties(); foreach (PropertyDescriptor pd in pdc) { Debug.WriteLine(pd.Name); }
This code uses the BindingManager to get the Propety Descriptors of the data. If you run the sample and follow the steps, you will see that the first time you click button1, there are two property decriptors in the collection: "Summary" and "Summary_Order". This is correct.
The second time you click button1, only the "Summary" PropertyDescriptior is returned. I don't know why "Summary_Orders" is not there, but it's nothing to do with the grid.
You get the same behavior even if the grid is never bound.
I reproduced your issue and I've logged it as a development issue with an ID# of 94920. I will make another post once the issue has been resolved.
Please note that the issue will only be resolved in NetAdvantage 2010 Volume 3 and later since older versions are no longer being maintained.