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.

Showing % in a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

17345 Aug 6,2004 02:21 AM Aug 6,2004 03:20 AM Windows Forms 4
loading
Tags: GridControl
Lokesh Luthra
Asked On August 6, 2004 02:21 AM

HI I want to change the cellvalue type of a cell as PERCENTAGE.Such that like if for a currency I enter 5 it shows on the grid as $5.SIMILARLY i want to put 5 and the cell should display it as 5%.I hope my Question is clear ....If possible mail me the answer at lokesh.luthra@tatainfotech.com Regards Lokesh

Administrator [Syncfusion]
Replied On August 6, 2004 02:44 AM

If the celltype is double (or decimal), then you can use the P format to display a decimal. style.CellValueType = typeof(double); style.Format = "P"; But this formatting accepts a number like .05 and displays iy a 5%. A 5 would be 500%. (It multiplies the values by 100). Here is forum thread with a sample. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16888 If you have numbers like 5 and want them displyed like 5% (instead of 500%), then you should handle the QueryCellFormattedText event and add the % there. You would also want to handle the SaveCellFormattedText to strip the % sign back out. If you want email notifications of updates, then you should use our Direct Trac system for your questions.

Lokesh Luthra
Replied On August 6, 2004 02:48 AM

HI Clay Thanx for your prompt reply Infact this is the problem I am facing but I would like to know How I can remove the 00 which is added coz my functionaliuty is like that I cant Ask the user to enter 0.5 >If the celltype is double (or decimal), then you can use the P format to display a decimal. > >style.CellValueType = typeof(double); >style.Format = "P"; > > >But this formatting accepts a number like .05 and displays iy a 5%. A 5 would be 500%. (It multiplies the values by 100). Here is forum thread with a sample. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16888 > >If you have numbers like 5 and want them displyed like 5% (instead of 500%), then you should handle the QueryCellFormattedText event and add the % there. You would also want to handle the SaveCellFormattedText to strip the % sign back out. > >If you want email notifications of updates, then you should use our Direct Trac system for your questions.

Administrator [Syncfusion]
Replied On August 6, 2004 03:19 AM

You would handle this case using QueryCellFormattedText and SaveCellFormattedText as mentioned in my previous post. Here is a sample.

Administrator [Syncfusion]
Replied On August 6, 2004 03:20 AM

Here is a sample. PushButtonOnCheck_1303.zip

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.

;