window.radopen with preset size?

9 posts, 1 answers
  1. Chris Gårdenberg
    Chris Gårdenberg avatar
    13 posts
    Member since:
    Nov 2008

    Posted 02 Feb 2011 Link to this post

    Hi,

    I use the radwindow to show detailed views of the data in a grid, but I want to set the popups in a preset size, so it doesn't open up a small 200x200px window and then resizes to the content size.

    Can I use something like:
    window.radopen('url_goes_here', 'window_name_here', width_goes_here, height_goes_here)
    or
    window.radopen('url_goes_here', 'window_name_here', 'width=width_goes_here,height=height_goes_here')

    Didn't find anything in the forum or documentation.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Feb 2011 Link to this post

    Hello Chris,

    You can use the ASP.NET AJAX $find() method to get a reference to the RadWindow on your page. Now you can use the client-side properties and methods  to manipulate the windows in the browser

    Please take look at these documentations.
    Opening Windows
    RadWindow Methods

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chris Gårdenberg
    Chris Gårdenberg avatar
    13 posts
    Member since:
    Nov 2008

    Posted 03 Feb 2011 Link to this post

    Hi Shinu,

    Thanks for the suggestion, but the problem I have is when I open the window. It resizes just fine after it's opened, but I have to make sure the window is opened with the size parameters, so the user won't see the animation or flickering of the resize.
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Feb 2011 Link to this post

    Hi Chris,

    What Shinu suggested is to open a specific RadWindow, by getting a reference to it, set its properties and show it after that.
    e.g.
    function showWin()
    {
     
        var oWnd = $find("<%= RadWindow1.ClientID %>");
        oWnd.setUrl("http://google.com");
        oWnd.setSize(600, 300);
        oWnd.show();
    }

    Currently, there is a small glitch in that funcitonality, as the window is shown in the top left corner of the page, but this will be fixed with the next update.

    Best wishes,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Chris Gårdenberg
    Chris Gårdenberg avatar
    13 posts
    Member since:
    Nov 2008

    Posted 03 Feb 2011 Link to this post

    Hi Georgi,

    Yes, that approach works fine when I have a predefined window, but this window opens with window.radopen

    And the most preferable solution would be to be able to use window.radopen('http://www.google.com', null, 800, 600);
    This is because we must be able to open more than one window at the same time.
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 08 Feb 2011 Link to this post

    Hi Chris,

    Thank you for the suggestion. Currently, this is not possible but I logged it as a new feature request in our PITS and updated your points.
    Here is a direct link to the PITS item:
    http://www.telerik.com/support/pits.aspx#/public/aspnet-ajax/4799

    By the way, regarding the glitch I talked about in my previous reply, we found out what is causing the problem and although the internal logic cannot be changed, you could avoid it by switching the steps - you need to first set the size of the window object and then set its Url.
    e.g.
    function showWin()
    {
      
        var oWnd = $find("<%= RadWindow1.ClientID %>");
        oWnd.setSize(600, 300);
        oWnd.setUrl("http://google.com");
        oWnd.show();
    }




    All the best,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  8. Answer
    Nishant
    Nishant avatar
    33 posts
    Member since:
    Jul 2012

    Posted 09 Jul 2012 Link to this post

    Instead of this :
    window.radopen('url_goes_here', 'window_name_here', width_goes_here, height_goes_here)
     

    try this:
    window.radopen(url_goes_here, window_name_here).setSize(width_goes_here, height_goes_here)
  9. David
    David avatar
    3 posts
    Member since:
    Jun 2013

    Posted 03 Jul 2013 Link to this post

    Thank you Nishant! Your .setSize(W,H) worked perfectly!
  10. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 03 Jul 2013 Link to this post

    Hi guys,

    Since Q1 2013 this functionality is built-in in the RadWIndowManager control. You can read more about it here: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html and test it live here: http://demos.telerik.com/aspnet-ajax/window/examples/radopen/defaultcs.aspx.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017