RadWindowManager Doesn't Center

4 posts, 0 answers
  1. Mitchell
    Mitchell avatar
    8 posts
    Member since:
    Mar 2012

    Posted 26 Apr 2012 Link to this post

    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")
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5701 posts

    Posted 27 Apr 2012 Link to this post

    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.
  3. Mitchell
    Mitchell avatar
    8 posts
    Member since:
    Mar 2012

    Posted 27 Apr 2012 Link to this post

    It is the scrolling I believe. Not sure how to deal with it.
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5701 posts

    Posted 02 May 2012 Link to this post

    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.
Back to Top