BringToFront for RadWindow

15 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. 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
  4. 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.
  5. 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?
  6. 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
  7. 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.
  8. 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
  9. 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.
  10. 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.
  11. 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
  12. Mahesh
    Mahesh avatar
    2 posts
    Member since:
    Feb 2017

    Posted 23 Feb in reply to Miroslav Nedyalkov Link to this post

    Hi,

    I am using BringToFront to bring my non modal window in front of all the windows on some message events. But If I have opened a modal window, this non modal comes on top of it if there comes any message. This makes me press Alt-Tab to see the modal window otherwise the UI becomes non responsive(as non modal window can not be moved).

    Is there any way of BringToFront not overriding the modal window/modal alert?

  13. Kalin
    Admin
    Kalin avatar
    1272 posts

    Posted 27 Feb Link to this post

    Hi Mahesh,

    What I can suggest you would be to also set the IsTopmost property of the RadWindow dialog to true. This way it would always stay on top - either if another Window is being brought to front.

    Please give it a try and let me know if this helps.

    Regards,
    Kalin
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  14. Mahesh
    Mahesh avatar
    2 posts
    Member since:
    Feb 2017

    Posted 28 Feb in reply to Kalin Link to this post

    Hi Kalin,

    There can be any modal window... sometimes the radalert where IsTopmost is not always available.

    Is there any way to check for any open modal window so that BringToFront() can be avoided... or any alternative method to BringToFront() which does not bring the non modal in front of modal window?

     

    Regards,

    Mahesh

  15. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    481 posts

    Posted 02 Mar Link to this post

    Hello Mahesh,

    I am not sure if I get your requirement absolutely right but if you want to set the IsTopmost property for an Alert, you can apply it through Style:

    <Style TargetType="telerik:RadWindow" x:Key="WindStyle" BasedOn="{StaticResource RadWindowStyle}">
            <Setter Property="IsTopmost" Value="True" />
        </Style>

    private void OnOpenIcon1Clicked(object sender, RoutedEventArgs e)
          {
              RadWindow.Alert(new DialogParameters { ContentStyle = Application.Current.Resources["Icon1AlertStyle"] as Style, Content = "Dialog with Icon 1.", Header = "Dialog with Icon 1" , WindowStyle = Resources["WindStyle"] as Style});
          }


    Regards,
    Stefan Nenchev
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top