Question about window.radopen positioning

3 posts, 1 answers
  1. Boris
    Boris avatar
    275 posts
    Member since:
    Oct 2012

    Posted 29 May 2013 Link to this post

    I have a Dot Net 4.0 web app using Telerik controls version 2012.2.607.40.  (I know, we're going to upgrade soon.... I hope)

    I'm using a simple window.radopen call to open windows:   
    var oWnd = window.radopen("ScreenName.aspx?Id=" + Id, "Screen Title" );    

    Do I understand correctly?  

    This version of radopen is not capable of setting the opening position (left and top) of a window?  I've been trying to control position but so far no good.
  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 30 May 2013 Link to this post

    Hello Boris,

    You are right, this version does not support the additional arguments in radopen() that set the size and position of the popup, nor the CenterIfModal property.

    You can, however, use the standard API of the control to achieve the same functionality:

    var wnd = window.radopen(url, nameWithoutSpaces);
    wnd.setSize(width, height);
    wnd.moveTo(left, top);

    Marin Bratanov
    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. DevCraft R3 2016 release webinar banner
  4. Boris
    Boris avatar
    275 posts
    Member since:
    Oct 2012

    Posted 30 May 2013 Link to this post

    Thanks!  Works perfectly.

    And a side note to others with the same problem.  

    If you want a window re-sized and centered based on the browser window, no matter what the size, try this:
       wnd.SetWidth($(window).width() * 0.9);                        
       wnd.SetHeight($(window).height() * 0.9);
       wnd.moveTo($(window).width() * 0.05, $(window).height() * 0.05);
Back to Top