Focus issue after closing a floating pane

2 posts, 0 answers
  1. Jason
    Jason avatar
    1 posts
    Member since:
    Feb 2012

    Posted 23 Jun Link to this post



    I'm trying to close a floating pane then open another window on top of my main form, however the main form being activated once the floating pane is closed resulting in the 2nd form being hidden. Setting the 2nd form to topmost isn't a solution for my requirements. How can I prevent the focus moving back to the main window's docking control?

    Here is the xaml code:

    <telerik:RadDocking x:Name="radDocking" BorderThickness="0" Padding="0" >
        <telerik:RadSplitContainer x:Name="WorkflowWindowContainer" InitialPosition="FloatingOnly" telerik:RadDocking.FloatingLocation="1250, 700" telerik:RadDocking.FloatingSize="600,250">
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Floater" x:Name="floatingPane" ContextMenuTemplate="{x:Null}" CanUserClose ="True" IsHidden="False" >
                    <Label Content="I'm a floating window"></Label>

    Code behind:

    floatingPane.IsActive = false;
    floatingPane.IsHidden= true;
    SecondWindow window = new SecondWindow();

  2. Georgi
    Georgi avatar
    344 posts

    Posted 27 Jun Link to this post

    Hello Jason,

    Please note that the floating pane in its basics is a Window and in order to be always shown when the RadDocking is visible (not go behind) it has Owner the RadDocking. So like standard WPF window when it is closed the focus moves to its owner - the MainWindow.

    Therefore what I would suggest is to set owner to the SecondWindow - it can be for example the RadDocking or the MainWindow as this would prevent the SecondWindow to appear behind the MainWindow in all scenarios.

    Also more on window ownership and activation you can read in this MSDN article.

    Hope this would help.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top