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

RadWindowManager Doesn't Center

3 Answers 83 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mitchell
Top achievements
Rank 1
Mitchell asked on 26 Apr 2012, 08:10 PM
Hi, I'm using RadWindowManger in a DNN module and calling it up from the server side. However, when it pops up it stays at the center of the screen for a moment, but then pops up centered as if the scroll bar was all the way up. This is more noticeable when the module is further down the page. To the user it will pop up for a moment then move outside of the scroll area if it's scrolled down far enough. Here's the server side code and .ascx code. The .ascx code is located at the very bottom of my .ascx if that matters.

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" KeepInScreenBounds="True"></telerik:RadWindowManager>
<script type="text/javascript">function alertCallBackFn(arg) { }</script>

RadWindowManager1.RadAlert("An error has occured!", 330, 100, "Error", "alertCallBackFn")

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 27 Apr 2012, 05:03 PM
Hi Mitchell,

It is possible that the AJAX request scrolls the page. This is a default browser behavior when dealing with postbacks and AJAX requests and there are numerous resources on the net related to handling this page scrolling. The behavior should manifest after any request from this module, not only when a RadWindow is being shown.

If I have misunderstood you and the actual page does not scroll I am not certain what the exact problem may be without being able to reproduce it, yet I can suggest that you inject the call to the RadAlert as explained in this help artiicle. You may add a small timeout when calling the RadAlert (even 0ms may suffice). It if does not help you can store a reference to the alert popup (the radalert() method returns it) and call its center() method after it is shown (you can again try adding a timeout if it does not work initially).


Greetings,
Marin
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Mitchell
Top achievements
Rank 1
answered on 27 Apr 2012, 07:05 PM
It is the scrolling I believe. Not sure how to deal with it.
0
Marin Bratanov
Telerik team
answered on 02 May 2012, 02:11 PM
Hi Mitchell,

One way is to store the scrollTop property of the window object before the request (e.g. in a hidden field, in the OnClientClick event of the button or in the PageRequestManager beginRequest Event), then when the response is received you can restore its value, e.g. by handling the PageRequestManager endRequest Event. More details are available in the net, for example this article or generally this google search.


Regards,
Marin
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Mitchell
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Mitchell
Top achievements
Rank 1
Share this question
or