Floating Window Currency Symbol Changes

2 posts, 0 answers
  1. Robert
    Robert avatar
    271 posts
    Member since:
    Mar 2011

    Posted 29 Sep 2012 Link to this post

    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


  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Oct 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top