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

Modal Window Not On Top

9 Answers 676 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brian Barnes
Top achievements
Rank 2
Brian Barnes asked on 18 Dec 2009, 03:18 PM
I have just started using the Rad controls for WPF and have come across an issue I cannot resolve on my own. 

I open a RadWindow with the ShowDialog() function call.  The window appears, and is in Modal mode, however, if I set focus to another application, when I come back to my WPF application, the modal window is no longer on top.  There are no icons for the modal window in my task bar.  The only way I can get back modal window is to use the Alt-tab functionality.

In the XAML my Radwindow is defined:

                <telerik:RadWindow Name="radManagePartsWindow" Height="530" Width="1000"
                                   telerik:Theming.Theme="Office_Blue" Visibility="Collapsed"
                                   ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
                                   CanMove="True"
                                   Header="Part Manager"
                                   Opened="radManagePartsWindow_Opened"
                                   Closed="radManagePartsWindow_Closed" Activated="radManagePartsWindow_Activated"
                                   >
In my code I access it via:

        private void btnManagePart_Click(object sender, RoutedEventArgs e)
        {
            radManagePartsWindow.DataContext = DataContext;
            radManagePartsWindow.ShowDialog();
        }
How can I get the modal window to ALWAYS be on top?


9 Answers, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 19 Dec 2009, 01:51 PM
Hi Brian Barnes,

The RadWindow control for WPF is actually using a WPF Window control "behind the scene" to implement the modal logic. Because of this, the RadWindow control acts just like the Window control in WPF - if you have a main window that shows the RadWindow control and you need to make the RadWindow control be always on top of it, you just need to set the Owner property of the RadWindow control to be the main window.

Regards,
Boyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Klaus Byskov Hoffmann
Top achievements
Rank 1
answered on 22 Jan 2010, 12:28 PM
Dear Boyan,
Thanks for that. I was having the exact same problem and your suggestion has solved it for me.

Kind regards,

Klaus
0
Geoff Smith
Top achievements
Rank 1
answered on 28 Apr 2010, 04:36 PM
Is there a way to set the owner for RadWindow.Alert? 
0
Miroslav Nedyalkov
Telerik team
answered on 29 Apr 2010, 01:37 PM
Hello Geoff,

 In the latest version of RadControls for WPF, the DialogParameters class has an Owner property that allows you to specify an owner. Please keep in mind that the owner should be either a RadWindow or a Window control.

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
Pavel
Top achievements
Rank 1
answered on 19 Feb 2011, 10:37 AM

I have got similar problem. But I´m opening RadWindow from UserControl, so can´t set owner to UserControl. Is there another way how to set RadWindow opened from UserControl always on the top? I tried to set owner to RadRibbonMainWindow, but that doesn´t work.

My code:

App.xaml.cs

namespace Administration2010 
    public partial class App : Application 
    
        public App() 
        
            // user control 
            MainWindow MainWindow = Administration2010.MainWindow.Instance; 
    
            RadRibbonMainWindow ribbonWindow = Administration2010.RadRibbonMainWindow.Instance; 
            ribbonWindow.Content = MainWindow; 
            ribbonWindow.Show(); 
        
    
}

EDIT: I´m sorry, that works to set Owner at RadRibbonMainWindow. I did something wrong.

0
Viktor Tsvetkov
Telerik team
answered on 24 Feb 2011, 10:14 AM
Hello Pavel Bily,

I am not sure what exactly you problem is, so could you please send us your sample application and tell us the steps to reproduce the issue?

Greetings,
Viktor Tsvetkov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Pavel
Top achievements
Rank 1
answered on 25 Feb 2011, 12:15 PM
It´s all right already as I wrote at the end of my post. I have inside of Window UserControl. And from code behing of UserControl displays RadWindow. But I can set Owner property to Window (parent of UserControl) and it works then.
0
Saykor
Top achievements
Rank 2
answered on 17 Sep 2012, 06:41 AM
OrderWindow ow = new OrderWindow();
                        ow.ResizeMode = ResizeMode.NoResize;
                        ow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                        ow.Header = mi.Header.ToString();
                        ow.Owner = this; //this is a Page
it seems i cannot  add Owner to be my page. Need to be a UserControl
0
Miroslav Nedyalkov
Telerik team
answered on 18 Sep 2012, 08:04 AM
Hi Dimitar,

The Owner of the RadWindow control is meant to be either another RadWindow control or a WPF Window control. Any other type of owner will be ignored by the RadWindow control.

All the best,
Miroslav Nedyalkov
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
Window
Asked by
Brian Barnes
Top achievements
Rank 2
Answers by
Boyan
Telerik team
Klaus Byskov Hoffmann
Top achievements
Rank 1
Geoff Smith
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Pavel
Top achievements
Rank 1
Viktor Tsvetkov
Telerik team
Saykor
Top achievements
Rank 2
Share this question
or