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

Grid Column Format

2 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nisarg
Top achievements
Rank 1
Nisarg asked on 29 Dec 2014, 10:16 PM
Hi there,

I want to format my Price columns as a currency. So I set the format option in columns to "{0:c}". Now when I update the grid data source.data, the format goes away. I can construct the whole grid again, but I want to know if there is way to do it more efficiently.

Below is snapshot of code.

Thanks in advance, Nisarg

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 31 Dec 2014, 02:51 PM
Hi,

This will happen if the new Price value is not a JS Number instance (e.g. a string). The currency formatting works only with numbers.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Nisarg
Top achievements
Rank 1
answered on 31 Dec 2014, 03:04 PM
Oh. Ok. Well first, I fixed this with getting options and setting the data within its data source, but that removed all the event handlers that were attached to elements inside the grid. So I just used a rowtemplate, which works fine. But I will keep this in mind.

Thank you
Tags
Grid
Asked by
Nisarg
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Nisarg
Top achievements
Rank 1
Share this question
or