<
telerik:RadWindow
ID
=
"radwindow1"
VisibleTitlebar
=
"false"
VisibleStatusbar
=
"false"
<br> BorderWidth="0" Title="Image" runat="server" VisibleOnPageLoad="false" Modal="true"<
br
> Autosize="true"><
br
> <
contenttemplate
> <
br
> <
img
alt
=
""
id
=
"image1"
/> <
br
> </
contenttemplate
><
br
> </
telerik:RadWindow
>
The image1 size is unknown, it can be any size. Click a button will open radwindow1 using javascript:
var oWnd = $find('<%=radwindow1.ClientID %>');<
br
> if (oWnd) { <
br
> oWnd.autoSize(true);<
br
> oWnd.show();<
br
>}
It works fine on Firefox but not in IE 8. First time open it on IE 8 will work fine but next time will show pop up with scroll bars, then next time will be fine and next time not.
My doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Thank for your time!
7 Answers, 1 is accepted
The AutoSize functionality depends on the content of the RadWindow having explicit dimensions set in pixels. If they are not present you may get some unexpected behavior, or it may sometimes work correctly.
What I would recommend is that you add a handler to the load event of the image and invoke the autoSize() function explicitly. I believe you may find the following thread useful in the matter: http://www.telerik.com/community/forums/aspnet-ajax/window/problem-with-center-window-after-autosize.aspx as this approach is used there.
Best wishes,
Marin
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.
I am sorry to hear that the solution from the other thread did not work for you.
Take your own time and isolate your case in a simple, runnable project that we can debug. When you are done please open a support ticket and send it back to us and we will examine it right away.
All the best,
Marin
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Thanks,
Michael
The AutoSize property is not intended to resize the content inside the RadWindow but to resize the RadWindow according to the inside content. If there is not a single size in your content, it is not possible to understand how to fit the content - e.g with a large width or large height, etc. That is why there should be at least one element inside the content of the RadWindow to instruct on how to resize. Most often it is not needed to explicitly set it but it depends a lot on what is the content itself. As you understand, the RadWindow is only the container and it should not determine the size of the content but the content should determine the container size when AutoSize is used.
Please, examine the demo below and test the settings explained in it:
http://demos.telerik.com/aspnet-ajax/window/examples/autosize/defaultcs.aspx
In case you face a problem with your particular case (this will work out of the box in most cases), prepare a simple, fully runnable demo, open a support ticket and send it to us along with detailed explanations and we will help you achieve what you need so that you will be then able to apply the same logic in your original application.
Svetlina Anati
the Telerik team
If you see the below two screen snippets. The first shows the initial size, the second shows the size once some options have been selected. Its only the window titled "add rules" the background is the rest of the page. I don't have any screenshots with the RadWindow as once I found it didn't work i removed the code. Unfortunately, I cannot share the current code however, if you still believe it is required I can create an example project.
Thanks,
Michael
As far as I understood from your explanations, the RadWindow autosizes fine when it is initially opened. After that you change the size of the content and the RadWindow stays the same size. This is the correct behavior by design - the RadWindow automatically autosizes when it is opened. To make it autosize again explicitly, you should call its method autoSize when you change the content size. The autoSize method is documented below:
http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html
and you can make the make the RadWindow autosize itself with an animation or not, controlling that with an input parameter.
In addition, you can see this in action in our online demo below:
http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx
When you open the RadWindow and you show the calendar dropdown, the RadWindow autosizes itself. When the calendar dropdown is hidden, the window autosize back to the changed size.
Please, examine the provided resources and use the suggested approach. In case you still experience problem, please share sample demo page - there is no need to show your actual content, just put the same elements and logic - e.g DIV, random strings, etc since the content information, databases, etc itself is not what matters in the case but the layout configuration.
Svetlina Anati
the Telerik team