I've attached a sample project that reflects some strange behavior I'm seeing in the v12.1 Infragistics windows forms (ultragrid specifically). I'm trying to allow the user of the grid to group by formula columns and non-formula columns while also being able to refresh that same grid, but I'm seeing some wonky behavior in the following case:
1) Open up the sample solution and run it, resize the window to see all the columns
2) Drag-drop the column "1" into the header to group by that column
3) Drag-drop the column "formula column 2" into the header to group by that column
4) expand the first-level grouping and note the names of the grouping headers (should be like '1' I think)
5) Left click in the grid header (this is how I made a hook into the refresh of the datasource)
6) Expand the first-level grouping again and note the names of the grouping headers (there aren't any grouping headers in my case and I think this is strange)
Has this issue ever been reported? In some cases, I get "#calculating" (the text for a formula column that hasn't finished the calculations) so I get the impression that the grouping happens immediately at the time of datasource refresh, and unfortunately doesn't wait for the formulas to complete their calculations :( Is there any way to force the grouping to wait until the formulas have finished calculating?
Hi,
There is a workaround available to obtain the requested behavior. Please place the following code at the end of the RefreshGrid method to force the calculations to be completed and the grouping to be re-evaluated:
this.ultraGrid1.Update(); calcMan.ReCalc(-1); this.ultraGrid1.DisplayLayout.Bands[0].SortedColumns.RefreshSort(true);
Please note that you also need to change the sample to maintain a reference to the CalcManager component.
No, I don't think there is any way to do that.
Hello Jose/Mike,
As a workaround, I've found that I can use " band.SortedColumns.RefreshSort(true); ". This is something that I found in one of Mike's other forum post in a different context. I've confirmed that this "fixes" the originally stated problem when I call this method inside of the event handler for the CalculationsCompleted event (of the CalcManager); however, it presents another problem that makes the grid inoperable: the RefreshSort method directly or indirectly kicks off a recalculation (or something at the very minimum that causes the CalculationsCompleted to be fired again). Hence I get something of a grid that is constantly recalculating (clearly not good). It would be great if I could wait until the *final* firing of CalculationsCompleted. In other words, it would be great if I could wait until the entire grid was settled (all formula columns completed calculating) before I independently called RefreshSort (and disabled it from further calls until I dictate that it should happen). Is there some way to detect that the grid has settled/has finished all calculations?
Hello tamalecharley,
I will be happy to help you out with this issue.
I have created case # CAS-97341-0XRC0J for you to better assist you with this issue going forward. To access the case, simply log into your IG account and click on My Support Activity.
Please let me know if you have further questions in this matter utilizing the case created.
Sorry, I see the issue, now - it wasn't clear from your original description. I thought you were saying that the second level of grouping didn't display at all.
I'm going to forward this thread over to Infragistics Developer Support so we can look into this.