GridViewDataColumn custom formatting

5 posts, 0 answers
  1. developer
    developer avatar
    10 posts
    Member since:
    Jul 2014

    Posted 16 Sep 2014 Link to this post

    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
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Sep 2014 Link to this post

    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.
     
  3. developer
    developer avatar
    10 posts
    Member since:
    Jul 2014

    Posted 08 Oct 2014 in reply to Dimitrina Link to this post

    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?
  4. developer
    developer avatar
    10 posts
    Member since:
    Jul 2014

    Posted 08 Oct 2014 in reply to developer Link to this post

    With this instruction it works

    Me.Language = Markup.XmlLanguage.GetLanguage(Globalization.CultureInfo.CurrentCulture.IetfLanguageTag)
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 08 Oct 2014 Link to this post

    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.

     
Back to Top