concatenation in a formula

Hey there,

I have a grid with three cells. The first has a baseline numeric value, say 1000. The second one has an manual override value, say 1500. I need the third to display the difference between the two values both as a percentage and a difference, seperated by a '/'. I've nearly managed this using formulas with the following.

"=(ROUND(((1500-1000)/1000), 2) * 100) & \"% /\" & ROUND((1500-1000), 0)"

The problem is that the result is displayed contained within a pair of double quotes, ie.

'"50% / 500"'

What I would like to see is '50% / 500', no "s.

Any advice would be grealy appreciated.


B


1 Reply

JS Jeba S Syncfusion Team February 12, 2008 12:10 PM UTC

Hi Brian,

You can handle the DrawCellDisplayText event and control the display of the formula result. Below is the code snippets:


private void gridControl1_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
{
if( e.RowIndex>0 && e.ColIndex>0)
{
e.DisplayText = e.DisplayText.Replace("\"","'");
}
}


Please refer the sample which implements the above said feature:
http://websamples.syncfusion.com/samples/Grid.Windows/I71733/main.htm

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.



Loader.
Up arrow icon