This is a migrated thread and some comments may be shown as answers.

Using NumericTextBox for percentage values

1 Answer 453 Views
Input
This is a migrated thread and some comments may be shown as answers.
Crane101
Top achievements
Rank 1
Crane101 asked on 08 Jul 2010, 05:03 PM

Hi,

I've not been using Telerik for very long, so this may be an obvious one...

Iā€™m using a Grid control to display some percentages, which are stored in the database as decimal values  (0.02, 0.33, etc.)

I have set the DataFormatString of the appropriate columns in my grid to a percentage format - {0:0.00%} so that the values are displayed as whole percentages rather than decimals.

However, when the user opens up my edit form, I want to replicate the same behaviour in the RadNumericTextBoxes so that the user sees a percentage value (e.g.  ā€œ20%ā€), can input a new percentage, but the textbox will return the decimal value back to the data source (0.02).

Is this possible with the existing control, or do I have to create a specialised custom control?


Thanks,

Shane

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 09 Jul 2010, 09:25 PM
Hello Shane,

You can use GridNumericColumn with NumericType set to Percent:
<telerik:GridNumericColumn NumericType="Percent" ...

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Input
Asked by
Crane101
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or