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

Rad window, KeepInScreenBounds property

2 Answers 109 Views
Window
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 31 Jan 2014, 09:21 PM
Hi, 

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

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

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 ?

Thanks,

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 03 Feb 2014, 02:12 PM
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"
                          OnClientShow="recenterPredefinedDialogs">
</telerik:RadWindowManager>
<script type="text/javascript">
    function recenterPredefinedDialogs(sender) {
        if (sender._isPredefined) {
            setTimeout(function () {
                sender.center();
            }, 100); //you can try adjusting(decreasing) this timeout
        }
    }
</script>

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.

Regards,
Marin Bratanov
Telerik
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.
0
Guillaume
Top achievements
Rank 1
answered on 03 Feb 2014, 09:24 PM
Thanks for your answer. The javascript you furnished is working properly !
Tags
Window
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Guillaume
Top achievements
Rank 1
Share this question
or