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

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

1 Answer 175 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Antonio
Top achievements
Rank 1
Antonio asked on 10 Oct 2011, 03:30 PM
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

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 11 Oct 2011, 09:09 AM
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 >>

Tags
GridView
Asked by
Antonio
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or