Modal Dialog appearing behind parent RadWindow

10 posts, 1 answers
  1. Mike Reynolds
    Mike Reynolds avatar
    5 posts
    Member since:
    Jan 2010

    Posted 25 Jan 2010 Link to this post

    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.
  2. Answer
    hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 26 Jan 2010 Link to this post

    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...
  3. DevCraft banner
  4. Mike Reynolds
    Mike Reynolds avatar
    5 posts
    Member since:
    Jan 2010

    Posted 26 Jan 2010 Link to this post

    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);
    }

  5. Josef Rogovsky
    Josef Rogovsky avatar
    144 posts
    Member since:
    Sep 2012

    Posted 29 Jul 2011 Link to this post

    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!
  6. Kellie
    Kellie avatar
    29 posts
    Member since:
    Feb 2009

    Posted 14 Oct 2011 Link to this post

    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.
  7. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 30 Apr 2012 Link to this post

    using Dispatcher.BeginInvoke does not work for me.  It will still show up in the background after the second click.

    Will this get fixed?
  8. Georgi
    Admin
    Georgi avatar
    347 posts

    Posted 03 May 2012 Link to this post

    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 >>

  9. Yatin
    Yatin avatar
    1 posts
    Member since:
    May 2012

    Posted 03 May 2012 Link to this post

    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
  10. Georgi
    Admin
    Georgi avatar
    347 posts

    Posted 04 May 2012 Link to this post

    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 >>

  11. Sven J
    Sven J avatar
    26 posts
    Member since:
    Nov 2009

    Posted 17 Aug 2012 Link to this post

    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);
Back to Top
DevCraft banner