BringToFront for RadWindow

11 posts, 0 answers
  1. yonadav
    yonadav avatar
    60 posts
    Member since:
    Oct 2009

    Posted 27 Apr 2010 Link to this post

    Hi,

    We'd like to share our solution for bringing a RadWindow to the front of the view (for example, when it's been hidden by other windows). This function is included in a class that inherits from RadWindow:

            public void BringForward()
            {
                Window realWindow = ((Canvas)Parent).Parent as Window;
                realWindow.Activate();
                realWindow.Focus();
            }

    HTH,
    yonadav
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Apr 2010 Link to this post

    Hi Yonadav,

     Thank you for sharing your code!
    The RadWindow control has a BringToFront method, that does exactly the same thing and handles some more scenarios as well. Did you try using it instead adding custom methods for this?

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. yonadav
    yonadav avatar
    60 posts
    Member since:
    Oct 2009

    Posted 16 May 2010 Link to this post

    Hi Miroslav,

    Sorry for the delay. We've started out using the BringToFront of RadWindow but it didn't solve our problem. Note that when we're trying to bring to front it means on top of windows of other applications (such as a browser, Outlook, etc.). The solution above is the only thing that worked for us (notice we're controlling the real WPF Window, not the Telerik one).

    We could shed any more light on this if you require.

    Thanks,
    yonadav
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 19 May 2010 Link to this post

    Hello Yonadav,

     You are right - if you need to bring the window to the front of all windows on the computer you need to find the real window and activate it. Thank you for sharing your solution.

    Best wishes,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. mariusz piatek
    mariusz piatek avatar
    16 posts
    Member since:
    Mar 2010

    Posted 24 Jun 2010 Link to this post

    But method BringToFront doesn't work in WebBrowser when I open RadWindow as a Dialog Multiple times.
    The second time window appears behind Parent window. How to solve this problem?
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Jun 2010 Link to this post

    Hi Mariusz,

     Could you please open a support ticket and send us a sample project that reproduces the problem? This would be very helpful.

    Regards,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. mariusz piatek
    mariusz piatek avatar
    16 posts
    Member since:
    Mar 2010

    Posted 17 Jul 2010 Link to this post

    Hello again,
    During  developing my XBAP application I discovered 2 bugs in RadWindow.

    1. When I set Owner property to parent RadWindow, and I open RadWindow as Modal, the modal Canvas is bad displayed (it don't cover all application pane, but it starts at left upper corner of parent window content).

    2. Most important bug.
    When I open few RadWindows (as modal) in browser eg. 1, 2, 3. Next I close windows 3, 2 , next I open again windows 2, 3 and when I close window 3, window 1 is focused and brought to front, but this should happen with window  2 not 1.
    The same happens when:
    open 1,2,3,4,5,6
    close 6,5,4
    open 4,5,6
    close 6
    Window 3 is focused, but should 5.

    I resolved this bug by making CustomRadWindow, and override OnOpened method (I added OwnerWindow property, because I don't use Owner property - see description for bug 1)

     protected override void OnOpened(RoutedEventArgs args) {
                    base.OnOpened(args);

                    if (this.OwnerWindow !=null ) {
                        Canvas cThis = ((Canvas)this.Parent);
                        Canvas cOwner = ((Canvas)this.OwnerWindow.Parent);
                        Canvas.SetZIndex(cThis,Canvas.GetZIndex(cOwner) + 1);
                    }

                }

    I think that bug 2 is connected with Z proprty. I saw in debugger that this internal property always have value 0. After I implemented by code, the value of Z started changing.
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 21 Jul 2010 Link to this post

    Hello Mariusz,

     I logged this issue in PITS and we will fix fix it in one of the future releases. The ID is 2765. You could use this ID to track the progress of the issue in PITS.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. mariusz piatek
    mariusz piatek avatar
    16 posts
    Member since:
    Mar 2010

    Posted 30 Jul 2010 Link to this post

    Hello,
    Unfortunatelly I found more bugs.
    1. When I use XBAP application, with modal RadWindows, and when I push Tab key,sometimes  controls that are behind the current active Window (on parent window) are also focuesed. Tab key should work only on currently focused Window.

    2. When child window is opening slow, and I click on parent window (child don't appear yet), sometimes parent window is focues. I think its  caused by method BringToFront - When parent window is Focused it is also  brought to front. As a result parent window appears before child window (after child window appears). To resolve this bug you should disable BrindToFront (or Focus event) for parent window at start of method ShowDialog. Event should be enabled when Child window was closed


    Best regards.
  11. mariusz piatek
    mariusz piatek avatar
    16 posts
    Member since:
    Mar 2010

    Posted 03 Aug 2010 Link to this post

    I resolve bug 1 this way

            protected override void OnPreviewKeyDown(KeyEventArgs e)
            {
                 if (!this.IsActiveWindow)
                {
                    e.Handled = true;
                }
            }

    But I think that this is not best solution.
    Please fix the bugs. RadWindow should not let to focus controls that are not on actualy active window.
  12. George
    Admin
    George avatar
    1332 posts

    Posted 04 Aug 2010 Link to this post

    Hi mariusz piatek,

    Thank you for reporting these issues. Your Telerik points are updated for reporting this abnormal behavior of our RadWindow control. We will fix these bugs in one of our future releases. You can track their progress in our Public Issue Tracking System (PITS) with Issue IDs = 2923 and 2953.

    Please do not hesitate to contact us if you require any further information.

    Regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready