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.

cell format

Thread ID:

Created:

Updated:

Platform:

Replies:

89280 Aug 21,2009 12:37 AM Aug 21,2009 10:04 AM Windows Forms 1
loading
Tags: GridControl
Stephen Hui
Asked On August 21, 2009 12:37 AM

Hi,

Is there an easy way to format a cell so that when user type in a number, say "80", when he finishes editing, the cell value will becomes "80%"? I used the Model.ColStyles.FormmatedText property but "###.##%" requires me to enter absolute value, which is 0.8

thanks!


Rajadurai C [Syncfusion]
Replied On August 21, 2009 10:04 AM

Hi Stephen,

Thanks for your interest in Syncfusion Products.

If you would like to append the percentage sign with the value entered in cell, it can be achieved by setting FormattedText property of GridStyleInfo object in PrepareViewStyleInfo event. Here is the code for your reference.

if (e.ColIndex == 5)
{
e.Style.FormattedText = e.Style.Text + "%";
}

Here is a minimal sample in which this has been implemented in gridcontrol.
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/F89280.zip

Regards,
Rajadurai

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.

;