I use a numeric updown control to allow the users to adjust numeric values to effect a change in my ultragrid. In my ultragrid InitializeLayout event I have the following:
... var band = e.Layout.Bands[0]; band.Columns["CalcMarkup"].Formula = "if ([Markup] > 0, [FinalCost]*([Markup]/100), 0)"; band.Columns["RemainingCost"].Formula = "if([CalcMarkup] > 0, 0, [FinalCost] )"; band.Columns["ForcedMarkup"].Formula = "if([RemainingCost] = 0, 0, ([RemainingCost]/[sumRemCost()])*[force()])"; ... grdMain.DisplayLayout.Bands[0].Summaries.Add("force", "[ForcedAdj()]", SummaryPosition.UseSummaryPositionColumn, grdMain.DisplayLayout.Bands[0].Columns["ForcedMarkup"]); ... var value = 1 - (nudMarginPer.Value/100); _marginFormula = string.Format("( ( ([finCost()]/{0})-sum([FinalCost]) )-sum([CalcMarkup])-5000000 )", "{0}"); band.Summaries.Add("ForcedAdj", string.Format(_marginFormula, value)); band.Summaries["ForcedAdj"].SummaryDisplayArea = SummaryDisplayAreas.None; ... grdMain.DisplayLayout.Bands[0].Summaries.Add("force", "[ForcedAdj()]", SummaryPosition.UseSummaryPositionColumn, grdMain.DisplayLayout.Bands[0].Columns["ForcedMarkup"]);in the numeric updown event: void nudMarginPer_ValueChanged(object sender, EventArgs e) { var value = 1 - (nudMarginPer.Value/100); grdMain.DisplayLayout.Bands[0].Summaries["ForcedAdj"].Formula = string.Format(_marginFormula, value); }
This works well in that when the user presses the updown buttons the summary (ForceAdj) values change and is reflected in the grid summary row. However the column formula for ForcedMarkup doesnt change until a second button press. So now the summary is correct however the value in the cell is off.
My question is this... How do I force the formula for ForcedMarkup (or any column formula) to refresh to reflect the current calcs?
I have tried forcing a grid update, calcmanager recalc, etc... nothing seems to work. I have attached a zip file containing the form.
thanks
Hello Jeff,
Thank you for the provided code, based on it I’ve tried to reproduce the issue you’ve got by implementing a simple sample using formulas from your project. I’ve used Infragistics 14.1 for my test. Please see attached zip. When the updown button is pressed both the summary value and the cell value are changed in my sample. So could you please review my sampel and modify it in order to reproduce this issue, ones I have sample that demonstrates your issue I will be glad to investigate and researcher this further for you.
I am waiting for your feedback.
Thank you for the simple program... it helped a lot... I have modified the program you sent me just slightly.... I added group by and you can now see the problem I am facing. Also we are using version 13.1.
Steps:
This is the problem I am having. The problem appears when I added a group by. Something I had not realized. Another thing too is that in our case, we have to set the default value of the updown control to 30. If you do this you will see the value is incorrect on the initial form load. only incrementing and then decrementing by 1 does the value seem to be correct.
Now add the following line in the InitializeLayout event at the bottom:
ultraGrid1.DisplayLayout.Rows.ExpandAll(true);
This will make things even more fun....
So... i guess this now begs the question ... how to fix this issue?
NOTE: I also tried this with 14.1 and the same issue/behaviour exists.
Hello ,
Thank you for the provided sample, I’ve created case for you in our issue tracking system, its id is CAS-140737-L8Y4B0, so I will update you via the case as soon as I have more information for you.
Thank you for your collaboration
On the following link you could see the list of Infragistics versions which are supported for service releases:
http://es.infragistics.com/help/product-lifecycle
Please see my response in your private case, where I’ve already explained the options of patch.
Please let me know if you have any issues to access your case.
As I mentioned earlier ... we are using version 13.1.
thanks!
Could you please verify the product version of the Infragistic’s components you’re currently using, in order to our engineering stuff to create a patch resolving your issue for the version you’re using.
Please let me know for which exactly version you want a pact.
Thanks for the reply. I would like to remind you I’ve created case for you in our issue tracking system, its id is CAS-140737-L8Y4B0,so please when you have some questions concerning the bug please ask them through the issue tracking system. I will really appreciate that. As you don't have a deadline as soon as our engineering staff end their examination of the issue you'll be immediately informed.
I dont necessarily have a deadline nor is this too much of an issue as I am using a working around (dont use groups). However at some point I would like to implement grouping because it will be easier for our users to handle their data better.