Mix DataFormatString {0:g} and {0:n}

2 posts, 0 answers
  1. Antonio
    Antonio avatar
    6 posts
    Member since:
    Jan 2011

    Posted 10 Oct 2011 Link to this post

    Hello, my question is about the RadGridView DataFormatString what I want is to mix two formats for each cell, the General format = {0: g} and Number; = {0: n}
    For example, my database bill in double: 1959247.98000, and what I hope is: 1,959,247.98
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 11 Oct 2011 Link to this post

    Hi Antonio,

    Generally, if you want to display the value as 1,959,247.98, you could define a DataFormatString as follows:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}" 
                                                Header="Stadium"
                                                DataFormatString="{}{0:0,0.00}"/>

    Will that fit into your requirements ? What do you mean by mixing two formats - when do you want to display each of them ?
     

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top