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.
Unfortunately, activation email could not send to your email. Please try again.

concatenation in a formula

Thread ID:

Created:

Updated:

Platform:

Replies:

71733 Feb 11,2008 06:39 PM Feb 12,2008 07:10 AM Windows Forms 1
loading
Tags: GridControl
Brian R
Asked On February 11, 2008 06:39 PM

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


Jeba S [Syncfusion]
Replied On February 12, 2008 07:10 AM

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.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;