RadTreeView within RadWindow - Resizing window on treeview Expand/Collapse

4 posts, 0 answers
  1. Jared Lewis
    Jared Lewis avatar
    9 posts
    Member since:
    Feb 2010

    Posted 05 Mar 2010 Link to this post

    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.

  2. Alan
    Alan avatar
    1 posts
    Member since:
    Jun 2010

    Posted 12 Aug 2010 Link to this post

    Did you find a resolution to this problem, as I am hitting exacly the same issue......?
  3. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 12 Aug 2010 Link to this post

    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.

  4. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 17 Aug 2010 Link to this post

    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
Back to Top