Rad window, KeepInScreenBounds property

3 posts, 1 answers
  1. Guillaume
    Guillaume avatar
    15 posts
    Member since:
    Oct 2010

    Posted 31 Jan 2014 Link to this post


    I am creating a Confirm Window via a WindowManager I have in my page :

    in aspx :
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">

    in code behind :
    RadWindowManager1.KeepInScreenBounds = true;
    RadWindowManager1.RadConfirm("Test", "OkButtonSave_fn", 330, 180, null, "Test");

    But I am having some trouble with the property that shoud display the RadWindon in the screen bounds.
    Most of the time the confirm Window is displayed way out of the screen limit, at the top of the page.

    Is there any trick I should use in order to have it displayed properly ?

  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 03 Feb 2014 Link to this post

    Hello Guillaume,

    The KeepInScreenBounds property puts back a RadWindow that is dragged out of the viewport inside, so that at least its top left corner is visible. This also goes for RadWindows that are larger than the available viewport.

    A RadConfirm, however, should open centered regardless of this property. If it does not, then there must be something on the page that is affecting it. It could be some CSS or a JavaScript error. For the former -please remove all CSS from the page and test again. Things like positioning of the form tag can break a radWindow's position. For the latter - examine your console and see if you can resolve any potential errors.

    Another thing I can suggest at this point is trying to force the confirm dialog to recenter after it shows:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
    <script type="text/javascript">
        function recenterPredefinedDialogs(sender) {
            if (sender._isPredefined) {
                setTimeout(function () {
                }, 100); //you can try adjusting(decreasing) this timeout

    If this does not help, I advise that you post here the code for a page that will show the issue so we can have a look at the actual case.

    Marin Bratanov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. Guillaume
    Guillaume avatar
    15 posts
    Member since:
    Oct 2010

    Posted 03 Feb 2014 in reply to Marin Bratanov Link to this post

    Thanks for your answer. The javascript you furnished is working properly !
Back to Top