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

cell format

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!


1 Reply

RC Rajadurai C Syncfusion Team August 21, 2009 02:04 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon