Hi there
We are using v12.1.20121.2038 of the UltraWinCalcManager in combination which the UltraWinGrid
I would like to display the FormulaBuilderDialog for a cell via a right click context menu item and have the formula effect a single UltraGridCell only rather than the entire UltraGridColumn or a SummaryColumn, which is what the Formula Builder At RunTime sample does.
Am I correct in thinking that because the UltraGridCell does not implement the IFormulaProvider interface that it cannot be done?
Is there a workaround via another property/object related to the UltraGridCell?
Is this possible and if so how? Do you have any samples?
Regards
geoffhop
Hi Mike
Yeah that's right. Got it working with the hidden UltraTextEditor now so the hidden column in the grid strategy is now redundant.
Thanks a lot for your help
Oh, I see. So the thing I was missing is that these calculations are one-shot. Normally, the CalcManager calculates continuously and updates as values are changed on the fly. But you are only doing them once. That makes sense now.
Not quite. Only 1 unbound column and 2 bound columns per row, The unbound column is the one the FormulaBuilderDialog is hooked to, the unbound column is invisible and will effectively have the same value for each row, i.e for a raw formula of 2+2 each cel in each rowl in this column would have a value of 4.
The 2 bound columns are the displayed to the user.
The first is the value of the last formula, not the calculated result just the raw formula string i.e. 2+2 but the cells value is only set when it is the row which has focus when the FormulaBuilderDialog is displayed, all other rows are NOT updated with the formula in this bound column only the current row. Each cell in the column will have a different raw formula string value.
The second bound column is the calculated result of the last formula i.e. for a formula of 2+2 the cell's value is 4. The cells' value is only set when it is the row which has focus when the FormulaBuilderDialog is displayed. Each cell in the column will have a different calculate formula result.
A right click context menu item on cell is used to provide a menu to display the FormulaBuilderDialog and I grab the raw formula string from the cell in first bound column of the CURRENT row and give to the FormulaBuilderDialog to use to display as the current formula.
Hope that makes sense!
Thanks again
Oh, I see. So you are going to have an unbound column for each formula? So that means potentially a column for every row in the grid?
That could get pretty inefficient, even with only 120 rows. I recommend that you test it out with 120 different formulas just to make sure it's going to be performant.
Yeah my requirement is for each cell in a column to have a value calculated for it from a formula but with each cell using a different formula. This is where the hidden column "bound" to a formula come's in. The hidden column has the formula applied to it using the FormulaBuilderDialog with the result of the formula's calculation then transposed to a single cell in my real column.
Your right the hidden text box would be more efficient which is why I asked about it and will be attempting to use.