Formatting Percentages

2 posts, 0 answers
  1. StevenDale
    StevenDale avatar
    100 posts
    Member since:
    Apr 2007

    Posted 02 Sep 2010 Link to this post

    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:#%}">


    Billy Jacobs
  2. Maya
    Maya avatar
    4062 posts

    Posted 03 Sep 2010 Link to this post

    Hi Billy Jacobs,

    You may try to set the DataFormatString Property as follows:

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

    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
Back to Top