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

DateFormatString vs ResultFormatString

2 Answers 188 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rodney
Top achievements
Rank 1
Rodney asked on 05 Mar 2013, 08:01 PM
Hi,

So I have this RadGridView with columns with currency and an aggregate sum functions for them.

Here is one of the columns:
<telerik:GridViewDataColumn UniqueName="y2sales"  DataMemberBinding="{Binding Path=Y2Sales}" DataFormatString="{}{0:C}">
<telerik:GridViewDataColumn.AggregateFunctions>
            <telerik:SumFunction FunctionName="y2salesTot" ResultFormatString="{}{0:C}" ></telerik:SumFunction>
      </telerik:GridViewDataColumn.AggregateFunctions> 
</telerik:GridViewDataColumn>

As you can see in the DataFormatString and ResultFormatString I put: {}{0:C} to show the number in a currency Format. 
And the culture I set is fr-CA. So basically, it is the same format string, it should be ex: 999 888 777,12 $ (for the currency with fr-CA)

But the output is not like that (see attached Picture)
The sumFunction (with the resultFormatString) is in the good format but the numbers in the grid (with the dataformatstring) are not in the good format ?

Why is that?

Thank You

    

2 Answers, 1 is accepted

Sort by
0
Rodney
Top achievements
Rank 1
answered on 05 Mar 2013, 08:39 PM
I fixed my problem!!

I just added this line :

this
.reportGrid.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name);
0
Maya
Telerik team
answered on 06 Mar 2013, 07:43 AM
Hi Rodney,

I am glad to see that you have resolved the issue you were having. Indeed, we have update the logic so that the grid respects the Language property for the CurrentCulture (in this way its behavior is consistent with Microsoft DataGrid). However, since there were a couple scenarios that cannot be accomplished just with Language property (like creating custom formats), we have introduced one new Property - IsLocalizationLanguageRespected (which default value is true). Once it is set to false, the culture will be the one defined with CurrentCulture property.

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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