This is a migrated thread and some comments may be shown as answers.

RadTreeView within RadWindow - Resizing window on treeview Expand/Collapse

3 Answers 132 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jared Lewis
Top achievements
Rank 1
Jared Lewis asked on 05 Mar 2010, 08:47 PM
I am putting a RadTreeView within a RadWindow (div - not separate page) I must be able to dynamically control the size of the window based on the treeview and other conditions. Most of the time, the window.autoResize will suffice, however, when I use the window.autoSize() function of the RadWindow along with the treeview clientside events [OnClientNodeExpanded  & OnClientNodeCollapsed] I get scrollbars that are unnecessary. No css has been able to remove the scrollbars. It seems as though the window.autoResize() method is happening prior to the completion of the treeview events I am wired-up to.

Any thoughts as to why I have to wait for the treeview's client events to finish in order to resize the window and get the scrollbars to go away?


P.S. I believe this is a bug, so I did submit a support ticket along with sample project, but was thinking that maybe someone here may have run into this issue before and may have a solution.

Jared

3 Answers, 1 is accepted

Sort by
0
Alan
Top achievements
Rank 1
answered on 12 Aug 2010, 11:54 AM
Did you find a resolution to this problem, as I am hitting exacly the same issue......?
0
Cori
Top achievements
Rank 2
answered on 12 Aug 2010, 02:06 PM
Why don't you try calling the autoSize method after a certain amount of time, to allow the TreeView events to complete. Like so:

setTimeout("window.autoSize()", 1000);

I hope that helps.


0
Georgi Tunev
Telerik team
answered on 17 Aug 2010, 02:09 PM
Hi guys,

Cori, you are right (assuming that the window object in your code refers to the RadWindow object and not the browser's one).

Alan, I have already answered your support ticket on the same subject - for convenience I will paste part of my reply below, as it answers Jared's question too.

Basically, RadWindow's AutoSize feature works automatically on page load. When you initially load the page in the control, RadWindow will check the size of the content and will resize itself accordingly. It however, does not monitor the content constantly as that would severely degrade the performance. That is why if you dynamically change the size of the content (by expanding the treeview), you need to manually call autoSize() again, so the changes affect the size of the window.
RadTreeview has an OnClientNodeExpanded property that allows you to hook to the nodeExpanded event. You can call autoSize() there (a small timeout may be needed so the RadWindow would take the correct page's size). This approach was used in our Returning Values from a Dialog demo where RadWindow is auto-sized on datepicker's OnPopupOpening / OnPopupClosing events.


Sincerely yours,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Jared Lewis
Top achievements
Rank 1
Answers by
Alan
Top achievements
Rank 1
Cori
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or