Replies
What data type is your Category_id ? If it is numeric, you shouldn't have quotes around the values.
You don't do Sum(If(… UltraGrid does not have a SUMIF or SUMPRODUCT the way Excel does.
You create an unbound calculated column with the formula if(u_id = X, annual_spent, 0)… Name it, say, Selected_annual_spent. Then in the textbox you say sum([//UltraGrid/BandName/Selected_annual_spent]).
Make sure your BandName is correct – if you're binding the grid to a datatable at run time, the band name is the table name.
Hope this helps
Found it,
I was binding the datatable to the grid by doing dgvWOVals.DataSource = <DataTable>, which overrides the schema. Therefore in the formula the Band key has to be replaced with the table name, so in my case that would be
"sum([//dgvWOVals/Valuations/MV] )"
instead of
"sum([//dgvWOVals/Band 0/MV] )"
Thanks for the reply, though.
Hi,
I've tried doing what you suggested, but I get an "Invalid or unavailable reference" error.
I have an UltraGrid called dgvWOVals where I manually define column MV of type Double. I also have a TextBox where I want to show the sum of MV. I can see the grid in the Formula Builder and I can reference the relevant column, however if I add the formula "sum([//dgvWOVals/Band 0/MV] )" to the TextBox I get the error.
I've tried the same thing using DataGridView and it worked, but I need to use UltraGrid because I need to create calculated columns and drive some of the other calculations off them.
Also, because UltraGrid loses all settings when the Data Schema is changed, I tend to do all formatting, binding and all calculated columns at run time. Will I still be able to reference columns created at run time through UltraCalcManager.
As a general statement I find that UltraCalcManager only works under some strict conditions and fails if any of the conditions are not met. Is there a good tutorial outlining when it will and will not work?
Thank you