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

format grid cell data to currency

8 Answers 141 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
mjaisi p
Top achievements
Rank 1
mjaisi p asked on 28 Aug 2009, 03:42 PM
how to format the input number to currency format in a cell in telereik grid

8 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Aug 2009, 06:50 AM
Hi mjaisi p,

You can use DataFormatString column property (UnitPrice column in this demo) or IValueConverter for the column binding.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
mjaisi p
Top achievements
Rank 1
answered on 31 Aug 2009, 06:55 AM
Hi

could you please send code for it.

Thanx
mjaisi
0
mjaisi p
Top achievements
Rank 1
answered on 31 Aug 2009, 07:01 AM
Hi

I saw the code, however i dont find the property "ResultFormatString" in my xaml for

My code:

<

 

gridView:GridViewDataColumn Width="180" UniqueName="Amount" Header="Compensation Change" DataFormatString = "{}{0:0.0}" />

 



thanx
mjaisi
0
mjaisi p
Top achievements
Rank 1
answered on 31 Aug 2009, 07:13 AM
Hi

I currently use this version - 2009.2.701.1020

Am i using the right version.

Thanx
mjaisi
0
mjaisi p
Top achievements
Rank 1
answered on 01 Sep 2009, 06:37 AM
hi

see my below code. still i am unable to convert a number entered (120 to 120.00).

After completing the edit, when i move from one cell to another, i dont find the number is formatted from 120 to 120.00.

<

 

gridView:GridViewDataColumn Width="180" UniqueName="Amount" Header="Compensation Change" DataFormatString="{}{0:c}" >

 


Thanx
mjaisi
0
Pavel Pavlov
Telerik team
answered on 03 Sep 2009, 08:54 AM
Hi mjaisi p,

I have prepared a sample project to test for possible faults. Everything seems ok to me .
Please have a look at the sample attached.
It uses your format string , and the resulting display is number formatted as currency.

In case you still get the wrong formatting , please try with the "{}{0:0.00}" format string.
Since the "{}{0:c}"  syntax is dependant on the system currency format settings it will get different output on different machines depending on the local settings.


Sincerely yours,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jack Helm
Top achievements
Rank 1
answered on 06 May 2010, 01:46 PM
I have searched these forums and also looked in the help file that comes with the contorls and have yet to find anyplace that explains adequately how to use the DataFormatString setting. Have you, anywhere that I may have missed, listed the various formats or how to create custom formats for this XAML setting? Or does it use the same conventions that Microsoft string formatting uses? Some detailed examples of this would be helpful. Thanks.
0
Milan
Telerik team
answered on 10 May 2010, 09:00 AM
Hello Jack Helm,

The DataFormatString is the same format string that is used by Microsoft. Could you please take a look at this help page that list several numeric format strings.

Regards,
Milan
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
General Discussions
Asked by
mjaisi p
Top achievements
Rank 1
Answers by
Vlad
Telerik team
mjaisi p
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Jack Helm
Top achievements
Rank 1
Milan
Telerik team
Share this question
or