RadWindow and browser boundary issue

2 posts, 0 answers
  1. PPSDevs
    PPSDevs avatar
    21 posts
    Member since:
    Mar 2009

    Posted 12 Apr 2010 Link to this post

    I have a very long ASPX page with a pop-up RadWindow that displays when page is loaded. I want this window to move along with the page as user scrolls down the page. So I added "PIN" in the behavior property and it works.

    I also want the user to be able to move and/or resize the pop-up window. But I want the user NOT to be able to drag/resize the window beyond the browser boundary. I can't use RestrictedZoneID property of the RadWindow.

    I tried looking for sample but I couldn't fine one. Is there a way to achieve this? If yes, how? Please let me know asap.

    Thanks
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 13 Apr 2010 Link to this post

    Hello Manjeet,

    In such case I suggest to try the following code that must be hooked to the RadWindow's OnClientDragEnd eventhandler:

    function OnClientDragEnd(oWnd) 
        { 
            window.setTimeout(function() 
            { 
                var bounds = oWnd.getWindowBounds(); 
                if(bounds.y < 0) 
                { 
                    oWnd.moveTo(bounds.x,0); 
                } 
            }, 0); 
             
        } 

    The code above checks if the window is moved in a negative Y coordinate and if so - moves the Radwindow back on zero Y position. You could use it as a base and extend it further if needed.


    I hope this helps.

    Kind regards,
    Georgi Tunev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top