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

GridViewDataColumn DataFormatString percent input

3 Answers 844 Views
GridView
This is a migrated thread and some comments may be shown as answers.
didier
Top achievements
Rank 1
didier asked on 18 May 2011, 08:44 AM
Hi,
I have in my gridview to input a value as percent, i have used in my GridViewDataColumn  the
DataFormatString="{}{0:P}"
it's work perfectly in display but if i use it as input, if I input 5, on lost focus, the grid display 500 % !
How can i retreive the same thing that the radmaskedtextbox, i don't want to use a datatemplate just for that.
<telerik:RadMaskedTextBox    MaskType ="Numeric" Mask="p"

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 May 2011, 09:31 AM
Hello didier,

This would be the expected behavior. What you may try to do is to define the DataFormatString as follows:

<telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}"
                                            Header="Stadium"
                                            DataFormatString="{}{0:N0}%"/>


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
0
didier
Top achievements
Rank 1
answered on 18 May 2011, 09:45 AM
Thanks for your quick replay and solution,
Can i hide the '%' when the value is 0 ? like the {0:P} ?
0
Rossen Hristov
Telerik team
answered on 18 May 2011, 10:06 AM
Hi didier,

I don't think that you can

Since your question is really out of the scope of Telerik support, you can read this article regarding .NET String Formatting.

I hope this helps.

Greetings,
Ross
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
didier
Top achievements
Rank 1
Answers by
Maya
Telerik team
didier
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or