radwindow get_top and get_left functions return null

4 posts, 0 answers
  1. Matthew
    Matthew avatar
    9 posts
    Member since:
    Jun 2009

    Posted 29 Oct 2013 Link to this post

    In our web application we open other web pages inside a radwindow within the application that show reports or graphs. I have a javascript function for the OnClientDragEnd event and in this event I just do an alert like the following

    function newPosition(sender,args) {
    alert('left='+sender.get_left()+'  top='+sender.get_top());

    The alert shown states the left and top both equal null. I am using radwindowmanager and the event is set in here to be applied to the radwindows that are created. There is no restriction zone being applied so I dont know why I would not get values from these calls.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Oct 2013 Link to this post

    Hi Matthew,

    Please have a look into the following code snippet to get the Left and Top position of the RadWindow on OnClientDragEnd event.

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="true">
            <telerik:RadWindow ID="RadWindow" runat="server" OnClientDragEnd="OnClientDragEnd"
                OnClientDragStart="OnClientDragStart" NavigateUrl="ButtonClickOpenWin.aspx">

    <script type="text/javascript">
       var timer = null;
        function OnClientDragStart(sender, args)
            var position = sender.getWindowBounds();
            var x = position.x;
            var y = position.y;
            var popupElem = sender.get_popupElement();
            timer = setInterval(function ()
                var position = $telerik.getBounds(popupElem);
                var x = position.x;
                var y = position.y;
            }, 10);
        function OnClientDragEnd(sender, args) {
            var position = sender.getWindowBounds();
            var left = position.x;
            var top = position.y;
            alert("Coordinates after drag: Left:" + left + " Top: " + top);

  3. Henrik
    Henrik avatar
    23 posts
    Member since:
    Feb 2012

    Posted 14 Jan 2015 in reply to Shinu Link to this post

    I'm seing the same problem here.
    It seems like I need to use the method above, but isn't there an error in the documantaion then..  It states I can use the get_left and set_left:

  4. Marin Bratanov
    Marin Bratanov avatar
    4999 posts

    Posted 14 Jan 2015 Link to this post

    Hi guys,

    The correct method that will provide you with the current RadWindow dimensions is getWindowBounds(), as stated in the article Henrik linked about the client-side API of the RadWindow.

    The get_left() and get_top() methods return the server Left and Top properties, as stated in the descriptions: "Corresponds to the Left server property." and "Corresponds to the Top server property." respectively.

    I will also update the get_left() and get_top() decriptions to advise using the getWindowBounds() method, just like get_width() and get_height(). This change will be live with our next documentation upload.


    Marin Bratanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top