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

BringToFront for RadWindow

14 Answers 1028 Views
Window
This is a migrated thread and some comments may be shown as answers.
yonadav
Top achievements
Rank 1
yonadav asked on 27 Apr 2010, 10:11 AM
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

14 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 29 Apr 2010, 12:29 PM
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.
0
yonadav
Top achievements
Rank 1
answered on 16 May 2010, 04:19 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 19 May 2010, 12:46 PM
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.
0
mariusz piatek
Top achievements
Rank 1
answered on 24 Jun 2010, 02:50 PM
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?
0
Miroslav Nedyalkov
Telerik team
answered on 29 Jun 2010, 07:26 AM
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
0
mariusz piatek
Top achievements
Rank 1
answered on 17 Jul 2010, 05:43 PM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 21 Jul 2010, 03:53 PM
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
0
mariusz piatek
Top achievements
Rank 1
answered on 30 Jul 2010, 10:47 AM
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.
0
mariusz piatek
Top achievements
Rank 1
answered on 03 Aug 2010, 02:43 PM
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.
0
George
Telerik team
answered on 04 Aug 2010, 03:08 PM
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
0
Mahesh
Top achievements
Rank 1
answered on 23 Feb 2017, 06:27 AM

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?

0
Kalin
Telerik team
answered on 27 Feb 2017, 11:37 AM
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.
0
Mahesh
Top achievements
Rank 1
answered on 28 Feb 2017, 12:25 PM

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

0
Stefan Nenchev
Telerik team
answered on 02 Mar 2017, 10:46 AM
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 you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Window
Asked by
yonadav
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
yonadav
Top achievements
Rank 1
mariusz piatek
Top achievements
Rank 1
George
Telerik team
Mahesh
Top achievements
Rank 1
Kalin
Telerik team
Stefan Nenchev
Telerik team
Share this question
or