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

Modal Dialog appearing behind parent RadWindow

9 Answers 469 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike Reynolds
Top achievements
Rank 1
Mike Reynolds asked on 25 Jan 2010, 02:15 PM
Hi,

I have several Radwindows each with various buttons e.g. Edit and Delete.  When I click certain buttons a confirm window or a Radwindow containing a data entry form is displayed.  Some validation takes place in the DialogClosed event.  If the validation fails, I pop up an alert with the details of why the validation failed. The problem is that this alert dialog appears behind the parent window, from which the original button was clicked.  Once you click the alert dialog to give it focus it does come to the front and the original window is forced behind the modal "sheild" layer.
How can I make the alert dialog appear on top to start with?  Why is it appearing behind the initial Radwindow?

I have already looked at a topic where someone had a similar problem but the answer did not help me that much (http://www.telerik.com/community/forums/silverlight/window/radwindow-confirm-alert-prompt-bringtofront.aspx)

Thanks in advance for any light you can shed on this.

Mike.

9 Answers, 1 is accepted

Sort by
0
Accepted
hwsoderlund
Top achievements
Rank 1
answered on 26 Jan 2010, 10:22 AM
I have had huge problems with this in the past. Then I found that using Dispatcher.BeginInvoke when opening windows, alerts, confirms etc. seems to prevent the stacking order problems. So now I just do that, and the bug has not occured since. Just a suggestion...
0
Mike Reynolds
Top achievements
Rank 1
answered on 26 Jan 2010, 03:36 PM
Many thanks for your reply, Dispatcher.BeginInvoke() works a treat. 

For anyone else who faces this, consider something like:

private warningString; //global variable

public void Something()
{
    warningString = "Danger";
    this.Dispatcher.BeginInvoke(AlertUser);
}

private void AlertUser()
{
    RadWindow.Alert(warningString);
}

0
Josef Rogovsky
Top achievements
Rank 2
answered on 29 Jul 2011, 07:47 PM
Just ran into this issue with a RadAlert Window displaying behind a Silverlight Child Window.

The "BeginInvoke" trick worked for me.

Thanks for the sample code, Mike!
0
Kellie
Top achievements
Rank 1
answered on 14 Oct 2011, 10:49 PM
Thanks hwsoderlund and Mike!

Just came across this problem in silverlight using combination of <telerik:RadGridView> and <Popup> on the same xaml page 
You have saved me a lot of time.

Kellie Harrisson

Sierra Systems
Edmonton, Alberta.
0
Edward
Top achievements
Rank 1
answered on 30 Apr 2012, 03:11 PM
using Dispatcher.BeginInvoke does not work for me.  It will still show up in the background after the second click.

Will this get fixed?
0
Georgi
Telerik team
answered on 03 May 2012, 08:16 AM
Hello Edward,

Can you, please give more details about your scenario? Also the version of the controls you use could be useful. What you can try is using  IsTopmost property.


Kind regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Yatin
Top achievements
Rank 1
answered on 03 May 2012, 10:33 AM
Hi,

I'm also facing the same problem.
After using BeginInvoke, it started coming in front of the window only for first time from second time onwards again same problem, alert shows back of the window.

Code
Dispatcher.BeginInvoke(() => RadWindow.Alert("Error"));
Using telerik 4.0.30319










Thanks,
Yatin
0
Georgi
Telerik team
answered on 04 May 2012, 09:15 AM
Hi Yatin,

As you can see in the attached video using Dispatcher works in the attached project. Maybe in the hurry you have sent us the version of your framework instead of the version of the controls. Can you, pleass check it again and let us know? Also If you are not able to reproduce the issue in my project would be great if you can send us your code.

Kind regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Sven J
Top achievements
Rank 2
answered on 17 Aug 2012, 06:53 AM
Hi,

for all whom Dispatcher trick didn't work. For me, the following worked:

var w = new Window { Content = view, WindowStartupLocation = WindowStartupLocation.CenterScreen };
w.Loaded += (s, e) => w.BringToFront();
w.Show(modal:
true);
Tags
Window
Asked by
Mike Reynolds
Top achievements
Rank 1
Answers by
hwsoderlund
Top achievements
Rank 1
Mike Reynolds
Top achievements
Rank 1
Josef Rogovsky
Top achievements
Rank 2
Kellie
Top achievements
Rank 1
Edward
Top achievements
Rank 1
Georgi
Telerik team
Yatin
Top achievements
Rank 1
Sven J
Top achievements
Rank 2
Share this question
or