This is a migrated thread and some comments may be shown as answers.
How do you format currency or decimal values in the grid when in edit mode?
6 Answers 313 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brad Sumner
Top achievements
Rank 1
Brad Sumner asked on 17 Jun 2010, 05:34 PM
Update - never mind on the currency formatting and editing.  For decimal values with more than 2 places  [DataType(DataType.Text), Required] seems to work.

Decimal values are not keeping the correct number of places in edit mode.  For example, Format("{0:N4}") shows 4 decimal places correctly in the display view but the edit view only shows 2 decimal places.  

Thanks,
Brad

6 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Jun 2010, 09:44 AM
Hi Brad Sumner,

Currently we do not support custom number formatting with Ajax binding. We plan to provide such functionality with the next official release of the components, which will allow you to set format to the column, which will be applied on the client when Ajax binding is used.

Sincerely yours,
Georgi Krustev
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
Kan
Top achievements
Rank 1
answered on 29 Sep 2010, 03:45 PM
I noticed formatting is available now in Q2 release for ajax binding, but seems they are only for some standard format, e.g. {0:n} or {0:c}.

But not for these custom format string, even like {0:n0} and etc. So how can I format a number without decimal, for example. Advise? Thanks.

Kan
0
Georgi Krustev
Telerik team
answered on 29 Sep 2010, 04:01 PM
Hello Kan,

Client number formatting supports these custom numeric formats. Please give a try and let me know what your findings are.

All the best,
Georgi Krustev
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
Kan
Top achievements
Rank 1
answered on 29 Sep 2010, 04:19 PM
Basically, I want to format a decimal, without digits after decimal point, and with group separator.

e.g. 12345.00

 

 

 

columns.Bound(b => b.Budget).Format("{0:#,#}"); gives me 1,234,5
columns.Bound(b => b.Budget).Format("{0:n0}"); gives me n12345
columns.Bound(b => b.Budget).Format("{0:###,###}"); gives me #12,345

 

I need it to be 12,345.

Thanks

Kan
0
Georgi Krustev
Telerik team
answered on 30 Sep 2010, 02:57 PM
Hello Kan,

This is a known issue related with the client number formatting. I am glad to inform you that it is already fixed and the fix will be included in the Q2 2010 SP1 of the Telerik Components for ASP.NET MVC scheduled for the beginning of October.

Regards,
Georgi Krustev
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
Barry
Top achievements
Rank 1
answered on 19 Apr 2011, 05:18 AM
Hi,

I am encountering a similar issue. I have this code

c.Bound(m => m.CarbonDioxide).Title(

 

"CO2").Width(55).Format("{0:0.0000}");

 



In display mode, I get 4 decimal values but in edit mode I only get 2 decimal values.

I am using version 2010.3.1318. Please advice.
Tags
Grid
Asked by
Brad Sumner
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Kan
Top achievements
Rank 1
Barry
Top achievements
Rank 1
Share this question
or