I would like to use cal manager to sum columns 5 thru 10 on band 0, row 0 and place the SUM in a ultracurrency editor. I have tried many iterations but always get Invalid or unavailable reference. The grid is loaded from a business object at runtime and not from the designer. I have set up the editor per one of the example apps for only 1 column for testing and still does not work. Any pointers would be most appreciated.
Dim calcSettings As CalcSettings = Nothing calcSettings = Me.ultraCalcManager1.GetCalcSettings(Me.pvNet) calcSettings.Alias = "NetAmount" calcSettings.PropertyName = "Value" calcSettings.Formula = "sum([Me.grdSummary.DisplayLayout.Bands(0)/Column 5])"
yes I did. I replaced the grid using Spreadsheetgear. Much cleaner and easier than using the calc manager -- more like excel, but not excel.
thanks......
Hi,
I just wanted to know if you were able to solve your issue based on my suggestions or you still need help? Just let me know.
Thank you.
Hello,
With UltraCalckManger you could access a cell value if you use the approach which I already shown in my sample, where I have a column “ID”, which is unique for each row. There I am using formula like:
"[//UltraGrid1/BindingList`1(ID = 0)/Price0] + [//UltraGrid1/BindingList`1(ID = 0)/Price1]”
Which meant for the CalcManager the follows:
from UltraGid1, band – BindingList’1, find from column ID, row which has value 0 (ID = 0) and get the value from cell “Price0” then sums this value with from UltraGid1, band – BindingList’1, find from column ID, row which has value 0 (ID = 0) and get the value from cell “Price1”
Please let me know if you have any further questions.
Thanks. I really need to acces a cell data withing the grid when loaded from a bus object so I wouild need to access a row/column within the formula. I pretty much have what you sent, but I was trying to figure out how to do the formula calling something like
[//UltraGrid1/Row 0/Column 5] + [//UltraGrid1/Row 0/Column 6]
I am trying to make it act like an excel sheet in this respect....
As far as I understand your scenario you want to use UltraCalckManger to sum the values of cells of column 5 to column 10 of the first Band, only of first row. I have created a sample to illustrate how you could do this with UltraCalckManager, where I am using NamedReference to get the cells values from the first row and to display this sum in UltraCurrencyEditor. Please run the sample and let me know if this is what you are looking for. Another way to achieve your goal (if you will summing only 5 cells of the grid) is to handle InitializeRow event of the grid, to chect if e.Row.Index is 0 and to sum the needed cell and to set this sum as value of the UltraCurrencyEditor.