I have a formula in a Grid which works out a percentage increase.
The problem is obviously, if A1 is zero, it brings up an error.
Does Essential Grid support if statements in the formula like excel? (can't see anything in the documentation)
If not, does anyone know a way which I can get around this?
ADAdministrator Syncfusion Team March 2, 2003 05:45 PM
Exactly, what do you want to see when you divid by zero? Right now your formula shows the word 'Infinity' representing a value obtained when you divide by zero. Do you want to change the word 'infinity' to something else? Or do you want to change the zero to some other value or something of that nature so you always see a number is that cell.
To change the zero to some other value, you could write a custom function that handled, so a function names CheckIfZero. This function would eithe rreturn the value of the calculation if nonzero, and the other value if it is zero.
To change the word, you could handle PreviewStyleInfo and swap it out there. If you will explain exactly what you want to see in the cel, I could try to post some code snippets.
MAMacMarch 3, 2003 03:29 PM
Instead of having infinity being shown, in this example I would like to have a 0 being shown.
This could 0 or something else, for example, in another grid, I would like to have 100 (as in 100%) being shown.
Any help would be appreciated
ADAdministrator Syncfusion Team March 3, 2003 04:46 PM
The simplest way to do this is to handle the PrepareViewStyleInfo event, and swap out the Inifinity there.