hello.
please look at the Image. How to formula the column by part1 and part2? thanks!
Thanks for the feedback.
The mentioned error is expected, because our custom formula "GroupByColumnSumFunction" does not exist in the CalcManager. So we need to add this custom function to the CalcManager. For example:
private void Form1_Load(object sender, EventArgs e)
{
MyCustomFunction custFunc = new MyCustomFunction(ultraGrid1.Rows);
ultraCalcManager1.RegisterUserDefinedFunction(custFunc);
ShowFormulaBuilderDialog_2(ultraGrid1.DisplayLayout.Bands[0].Columns["formula5"] as IFormulaProvider);
}
private void ShowFormulaBuilderDialog_2(IFormulaProvider formulaProvider)
FormulaBuilderDialog formulaBuilderDialog = new FormulaBuilderDialog(formulaProvider);
//formulaBuilderDialog.ShowDialog(this);
formulaProvider.Formula ="GroupByColumnSumFunction( [part12], [part4] )";
Please take a look at the modifications that I made in our sample and let me know if you have any questions.
Regards
Hi,Georgi,You are too powerful.thank you very much!
I met a new problem, how to call custom formula?
I'm calling a custom formula in the form of the LOAD event, but there will be mistakes.
private void frmFormula_Load(object sender, EventArgs e){ this.ultraGrid1.DisplayLayout.Bands[0].Columns["formula5"].Formula = "GroupByColumnSumFunction( [part12], [part4] )"; }
If you need any additional assistance don’t hesitate to ask.
this is the sample
this is video file