Hello -
I have a tab control with two pages. Each page has an WinGrid control. When I started coding, I focused on just one grid. In this grid I have "running balance" column that takes a value from the previous row, adds/subtracts values in the current row and the result is shown in an unbound column. I have an UltraCalcManager in the form, and the following code worked just fine:
Me.UltraGrid1.DisplayLayout.Bands(0).Columns.Add("Balance", "Balance")
With Me.UltraGrid1.DisplayLayout.Bands(0).Columns("Balance")
.DataType = GetType(Double)
.Formula = "if " & _
"( " & _
"iserror ( [Balance(-1)] ), " & _
"0, " & _
"[Balance(-1)] " & _
") + [Charges] - [Credits]"
End With
Now when I add a second grid, the formula no longer works. Again, everything was working just fine with just the single WinGrid. What am I not doing correctly? Thanks for your time!
Hi,
I can't see any reason why a second grid would affect the first. What exactly is not working? Is the formula just not being calculated? Is it being calculated incorrectly? Is it displaying an error?
Hi, Mike. Thanks for the reply. There is no error, the formula is not calculating at all for either grid.
Hm. I can't see any reason why the second grid would cause that.
Are you sure nothing else changed? Perhaps you have changed a property on the CalcManager and set the calculations to manual?
Are the grid's and the CalcManager added to the form at Design-time?
It's really hard to guess what might be wrong without seeing the application for myself. Is it possible you could duplicate this in a small sample project and post it here?
I'm pretty sure nothing has changed, but since having the second grid is expected to work fine, I will go through the project again and make sure I haven't inadvertently changed something.
The grids and calc manager are added at design time.
I understand the difficulty in pinpointing the cause of something like this with next to no visibility. If I don't find anything while I double check the code, I will post a sample project, providing I can reproduce the problem. I will post a status update either way.
Thanks, Mike!
The sample project worked just fine, so there is something else that is causing my formulas to not work. I have a feeling it is due to my own error somewhere and not anything to do with Infragistics, so consider this "case closed".