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

How to localize numeric formats for radgrid column data

1 Answer 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom Parks
Top achievements
Rank 1
Tom Parks asked on 10 Dec 2009, 08:58 PM
I've been searching the documentation for a few hours, but have had no luck finding what I'm looking for.  What I need to do is display any integer and decimal data in a RadGrid formatted to a specified culture setting.  I can't hardcode the formats of each column since I am binding a datatable to the grid at runtime and each time it may have different columns with different datatypes.

I want to take a CultureInfo object, and just assign it to the grid and have it automatically format any columns with integer or decimal type data as appropriate to the culture.  Is there any way to do this? 

If its not that easy, is there some way to take the culture numeric format settings and apply them at item data bound time or something?

Also, I don't want to use resource files.  The number formats should be retrieved from the .net CultureInfo object.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Dec 2009, 07:08 AM
Hi Tom,

 Presently, there is no automated approach to handle this functionality.
One possible apptoach is to dynamically set the dataformat string to each column, either in the PreRender event handler, or ar the time when the column is created, depending on the current culture used. I hope this is a feasible approach for you.


Regards,
Yavor
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.
Tags
Grid
Asked by
Tom Parks
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or