AutoSize not working

3 posts, 0 answers
  1. Sanket
    Sanket avatar
    3 posts
    Member since:
    May 2009

    Posted 15 Jul 2009 Link to this post

    Hi,

    Scenario: I have an ImageButton.
    - On mouseover over the button, want to open a RadWindow, with size of the window fitting the Image. (the content).
    - On mouseout, want to close the window.

    <

     

    asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='http://xyz.com'

     

     

    Width="128px" Height="128px" Visible='true'

     

     

    onmouseover="OpenRadWindow(); return false;" onmouseout="CloseRadWindow()" />

     



    <

     

    telerik:RadWindowManager VisibleStatusbar="false"

     

     

    ID="RadWindowManager1" runat="server" ShowContentDuringLoad="false" Behavior="Close" AutoSize="true" >

     

     

    <Windows>

     

     

    <telerik:RadWindow ID="Popup" runat="server" AutoSize="true" Behavior="Close"/>

     

     

    </Windows>

     

    </

     

    telerik:RadWindowManager>

     

    function

     

    OpenRadWindow(UrlString) {

     

     

    radopen(UrlString, "Popup");
    }

    function CloseRadWindow()
    {
    // Get hold of "Popup" and close it
    }

    I am facing 2 issues:

    - The AutoSize is not working. The size it's taking is, 300 by 300px.
    - The "PopUp" is not the same as what's opened. When radopen is called, it's not the "PopUp" that's made visible, instead a different instance is created.


    Could you help with these 2 issues?

    Thank you.
    }

     

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 20 Jul 2009 Link to this post

    Hello Sanket,

    Straight to your questions:

    1. I am not sure what exactly you mean by saying that the opened RadWindow is not the one you have specified - in case you mean the url, it is not the one set to the button but you should either set it for the RadWindow as navigateUrl or pass it as an argument to your function.
    2. The AutoSize functionality resizes the RadWindow according to its content. However, in order to achieve this, it needs to extract the actual size of the content and as you might know you cannot manipulate a page from another domain through javascript (also known as cross site scripting) due to security reasons. That is why in your case it is not wokring but this is teh expected behavior i such case and this is general ASP.NET and javascript knowledge and not directly related to RadControls - you will get teh same result with a standard IFRAME element, too.
    3. I did not see where you have implemented the closure of teh RadWindow. That is why I implemented it for you as well as providing thr url and also used another dialog to demonstrate that the austosize is correctly working.  

    For your convenience I attached the demo I prepared for you to this thread and I hope that this is helpful.

    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 20 Jul 2009 Link to this post

    Hello Sanket,

    Straight to your questions:

    1. I am not sure what exactly you mean by saying that the opened RadWindow is not the one you have specified - in case you mean the url, it is not the one set to the button but you should either set it for the RadWindow as navigateUrl or pass it as an argument to your function.
    2. The AutoSize functionality resizes the RadWindow according to its content. However, in order to achieve this, it needs to extract the actual size of the content and as you might know you cannot manipulate a page from another domain through javascript (also known as cross site scripting) due to security reasons. That is why in your case it is not wokring but this is teh expected behavior i such case and this is general ASP.NET and javascript knowledge and not directly related to RadControls - you will get teh same result with a standard IFRAME element, too.
    3. I did not see where you have implemented the closure of teh RadWindow. That is why I implemented it for you as well as providing thr url and also used another dialog to demonstrate that the austosize is correctly working.  

    I hope that my explanations and the demo I prepared for you are helpful and attached it to the thread.

    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top