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

GridViewDataColumn custom formatting

4 Answers 302 Views
GridView
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 16 Sep 2014, 08:21 AM
Hi,

I need to display numbers in a GridViewDataColumn with a custom format.

For example if I have the number '1,234.56' I should display '1.234,56'. I tried to use the DataFormatString property but isn't enough because I can't change the decimal separator. I think that I need to access the CultureInfo but I didn't find a CultureInfo property in the column and I didn't find a CultureInfo property in the GridView.

How can I do?

Thank you

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Sep 2014, 07:39 AM
Hi,

You can check the Apply a custom format via the CurrentCulture article on how to apply a custom formatting.

Regards,
Dimitrina
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
developer
Top achievements
Rank 1
answered on 08 Oct 2014, 01:17 PM
Hi

Thank for your reply.

I tried to use your suggestion, but it doesn't worked for me (and I think that the article is an incorrect porting of SilverLight code, because the object 'this.RootVisual' used in the article doesn't exists in WPF).

I've made a simple project to explain my issue. Where can I upload it?
0
developer
Top achievements
Rank 1
answered on 08 Oct 2014, 01:44 PM
With this instruction it works

Me.Language = Markup.XmlLanguage.GetLanguage(Globalization.CultureInfo.CurrentCulture.IetfLanguageTag)
0
Dimitrina
Telerik team
answered on 08 Oct 2014, 01:52 PM
Hello,

The formatting of RadGridView is language specific. In order to have the current culture settings respected, you should set the IsLocalizationLanguageRespected for the RadGridView to FalseYou can also check our online documentation for a further reference.

Let me know how this works for you.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
developer
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
developer
Top achievements
Rank 1
Share this question
or