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

Floating Window Currency Symbol Changes

1 Answer 68 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 30 Sep 2012, 12:12 AM
Hi,

Ever since upgrading to the latest release of the WPF libraries (Q2 2012) I am experiencing issues with the currency format in my RadGridView. My PC is set to en-GB but the application was reporting values back in en-US.

I managed to overcome the issue by setting the following code in each of my windows & pages:

//Set Language
this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);


However, I have just stumbled across another issues.
I have a radgridview hosted in a RadDocking pane. When the pane is docked the currency reported in my cells are as they should be, en-GB (£). When the pane becomes floating, the grid cells switch back to en-US ($).

Do you know how I can prevent the culture of my pane from switching when it becomes floating?

Thank you for your time,

Rob


1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 04 Oct 2012, 03:41 PM
Hello Robert,

The reason for this behavior is that when the pane is floated state, it is hosted in a ToolWindow, which actually is not part of the visual tree of the MainWindow anymore. You should manually set its Language property - subscribe to PaneStateChange event of the Docking and in the event handler add the next snippet:

private void docking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    var pane = e.OriginalSource as RadPane;
    if (pane.IsFloating)
    {
        var window = pane.GetParentToolWindow();
        window.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);
    }
}

Hope this helps.

Regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Robert
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or