Hi,
I have an issue which causes the UI to lock up until *all* formulas are calculated for every row in the grid. Deferred calculations are false because I need all formulas to be calculated so I can perform other operations.
To nail down the issue I hooked in to the after cell update event and printed the row number of the updated cell only if it was in a formula column. I have approximately 150 formula columns in my grid which has about 2500 rows. I bind the grid and display all formula columns and instantly see the console being written out with row numbers sequentially (ie a bunch of 1s, a bunch of 2s, etc).
If I then click a formula column header to sort it I see the sequence keeps going, the grid is still calculating all formulas in each row. During this time the UI is also locked up because I suspect that the grid is waiting for all values in the sorted column to be calculated. This won't happen until all formulas in the entire grid have been calculated based on the output I see in the console.
I would expect there would be some kind of optimization where the grid would calculate only values in that column so it could sort and then it would resume calculating the rest of the formulas where it left off. If this behavior isn't possibly via some kind of setting is there anyway I can utilize the internal methods of the UltraCalcManager?
I've looked over the source code and think I could make it work but I wanted to know if it is even possible to do what I describe before I jump down that rabbit hole.
Thanks,
Boyd
Hi Boyd,
In order to sort on a formula-result column, the grid has to wait until every formula in that column is calculated, obviously. The CalcManager builds a network of calculations and it has a dependency tree that ensures that calculations which depend on other calculations are calculated first. But there's no way for the CalcManager to know about a particular grid column and re-arrange it's dependency tree to calculate that column first. Which column is calculated first is basically arbitrary. All the grid can do is tell the Calculation network to keep calculating until the column it needs has finished calculating.
Thanks for the info Mike.
I think a logical extension of that functionality would be to implement a priority queue such that sorting/grouping could be performed ahead of values that aren't necessarily needed ASAP.
For now I implemented some logic that builds a graph of formulas and their ancestors such that I can set the minimum amount of formulas on the grid to get the initial sorting/grouping/filtering correct for formula columns. After that operation is complete I set any other formulas I deem to be required but it would be great if this functionality was exposed via the UltraGridColumn or some other interface to give us more control over the CalcManager instead of my decidedly "hacky" solution.
I agree, this would be a very nice feature to have. I recommend that you Submit a feature request to Infragistics and maybe we can add something like this in the future.