Hi,
I have a dataset that can have 10+ datatables with data relations between all of them (table 1 which is a parent to table 2 which is a parent to table 3, etc). I bind it to a wingrid and am able to navigate it by expanding it level by level etc, just fine. For the most part, I can modify fields in rows in the grid without problem as well. However, there is a very peculiar case where if I modify a field in the first child row of a particular parent row, and there are at least 8 levels below it, then CPU utilization goes to 100% for a long time. The more levels below, the longer it takes to where it will never complete. The activity appears to be in the datasource, i.e. doing a Break All and looking at the stack trace, it is in the area of System.Data.DataView, System.Windows.Forms.RelatedCurrencyManager.ParentManager_CurrentItemChanged etc, but not in anything Infragistics.
Thanks,
Bill
Hi Bill,
I doubt this is specifically a grid issue. The BindingManager in DotNet isn't very efficient, especially with very deep hierarchies like this. Personally, I recommend keeping the depth of your grid to between 5 and 8 maximum. Anything more than that and the BindingManager will start to choke.
Realistically, no human user can deal with 10 levels of data hierarchy, anyway.
You could try wrapping your data source in a BindingSource, if you are not already doing so. Sometimes that helps, but not always.
You could also try setting the SyncWithCurrencyManager property on the grid to false. That way the grid doesn't synchronize the active row with the position of the BindingManager, which can be a very expensive operation in a deep hierarchy. This assumes that you are not binding other controls to the same datasource and need to keep them in synch with the grid.
Hi Mike,
Thanks for the reply. This app is a manufacturing "product structure maintenance" app. E.g. a laptop computer is composed of a case, LCD screen, disk drive etc, and each of those subassemblies is composed of components and so forth. Our customer is a manufacturer who is very vertically integrated and their product structures can get up to 24 levels deep.
Agreed that humans can't deal with info past 10 levels. But convincing this customer otherwise is a tough sell.
I tried using BindingSource and that fixed the field modification problem. However a side effect appeared: binding to the control took exceedingly long, and for products with more than about 16 levels it would not complete in a reasonable amount of time.
At this point I am thinking about doing binding at a lower level (e.g. creating Wingrid rows programmatically instead of via databinding then binding the Wingrid row cells directly to fields in datarows via container objects, or similar). It's extra effort but I think I can get it to work.
Also, SyncWithCurrencyManager was disabled originally.
Regards,