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

Formatting Percentages

1 Answer 572 Views
GridView
This is a migrated thread and some comments may be shown as answers.
StevenDale
Top achievements
Rank 2
StevenDale asked on 03 Sep 2010, 04:24 AM
2010 Q2 SP1
I have the following XAML which formats the value of a number to a %. So .25 will display 25%. However when the value is 0 it just shows % with no numbers. I want it to display 0%. How do I format it so that I will get my desired result?

<telerik:GridViewDataColumn Width="70" IsReadOnly="True" Header="Fit Plus" DataMemberBinding="{Binding FitPercentage}" DataFormatString="{}{0:#%}">

Thanks,

Billy Jacobs

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 03 Sep 2010, 07:32 AM
Hi Billy Jacobs,

You may try to set the DataFormatString Property as follows:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Number}"                                                                                                                 DataFormatString="{}{0:P}"/>
 

Regards,
Maya
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
GridView
Asked by
StevenDale
Top achievements
Rank 2
Answers by
Maya
Telerik team
Share this question
or