Z-Index for always-on-top

Thread is closed for posting
3 posts, 1 answers
  1. bc3tech
    bc3tech avatar
    14 posts
    Member since:
    Oct 2011

    Posted 24 Jun 2014 Link to this post

    Seems to me that the RadMessageBox isn't getting its z-index set to a "high value" such that it shows up always on top on the screen.
    I am using a grid to overlay a translucent RadBusyIndicator on the screen and ensure none of my controls are able to be hit while an operation is performed.
    If an exception occurs, and RadDiagnostics kicks off a messagebox, or I simply code one up to pop, it shows up under this RadBusyIndicator panel.

    Why? Because I have my panel's Canvas.ZIndex set to 99; so it's always on top of the other controls.
    But how can I ensure the messagebox shows up on top? I'd like to see Z-index be static at 99 for the messagebox, and this documented somewhere. That way when somebody wants to do what I'm doing they know to have their overlay at index 98 so messagebox popups aren't obscured.
  2. bc3tech
    bc3tech avatar
    14 posts
    Member since:
    Oct 2011

    Posted 24 Jun 2014 in reply to bc3tech Link to this post

    I should add that I had hopes that some other "high value" was being used so I tried values 50, 10, and finally 2. Even a z-index of 2 would overlay any RadMessageBox popups.
  3. Answer
    Lance | Tech Support Engineer, Sr.
    Lance | Tech Support Engineer, Sr. avatar
    607 posts

    Posted 25 Jun 2014 Link to this post

    Hi Brandon,

    In this case, instead of setting Z-Index you can just have the Canvas as the last item in the XAML (further down the page is higher on the UI) and it will naturally be on top of all the existing elements, but still be underneath any MessageBox.

    I've written a demo that better explains it (attached). See my code comments on MainPage.xaml and run it without the debugger attached. In it I use a RadBusyIndicator that is on top of the other elements on the page, clicking the left appbar button will show/hide the BusyIndicator which effectively blocks/unblocks the UI elements and clicking the right appbar button will trigger an exception.

    When the exception is unhandled, you'll see the RadDiagnostics appear on top of everything else.

    Final Note: One of the advantages to the IsRunning property of the BusyIndicator is that it also handles the Visibility property, allowing you to block/unblock the UI. This way, you don't need the canvas. You'll see this in the demo.

    This should have you up and running, but if you're still having trouble, send me the code that you're using for that view (or update my demo with your code) and I'll investigate further.

    Senior Support Specialist

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top