We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid Formula using a program variable

I am trying to use a formula cell but want to reference a variable from my program is there a way to do this?

sample would be
int total = 100;

style.CellType = "FormulaCell";
style.CellValue = "=(A0+B0)/100";

But I really want to pass in total in the formula to replace the literal 100.


1 Reply

AD Administrator Syncfusion Team November 14, 2007 02:12 PM UTC

Once the variable has been assigned a value, you can use:

style.CellValue = string.Format("=(A0+B0)/{0}", myVariable);

Then anytime myVariable changes, you would also have to reassign the formula.



Loader.
Live Chat Icon For mobile
Up arrow icon