How to use a slider to control the scale of items in a tree

5 posts, 1 answers
  1. Timothy Garton
    Timothy Garton avatar
    14 posts
    Member since:
    Sep 2009

    Posted 20 Jan 2010 Link to this post

    I am trying to implement a zoom function for a templated RadTree, and would like to tie the scale to a slider.  However I do not want to set the ScaleX/ScaleY values on the RadTree itself, as this does not achieve the desired results.  Setting the scale on the RadTree itself causes the entire control to shrink, I just want the items in the tree to shrink/grow while the RadTree itself continues to take up the entire screen.  I did find that using template binding I could set the Render Transform for the ItemPresenter in a radtree template to the same RenderTransform of the RadTree, and this did shrink the items correctly, but obviously, it also shrank the RadTree control.

    I did try making a ScaleTransform resource and setting its ScaleX/ScaleY values to the vlaue of a slider, but this caused invalid XAML, as if you can't do element binding to the scaleX/ScaleY.  I'm sure there is a simple solution to this, but how can I set the scale of the ItemPresenter without having to set the RenderTransform of the RadTree and still have it tied to a slider control?  Any Examples would be great!

    Thanks,
    Michael
  2. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 26 Jan 2010 Link to this post

    Hi Michael,

    Thank you for contacting us.

    We found your case very interesting and we would like to implement an example for. Please track this thread - we will write again soon.
     
    Kind regards,
    Ivan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Timothy Garton
    Timothy Garton avatar
    14 posts
    Member since:
    Sep 2009

    Posted 02 Feb 2010 Link to this post

    Just wanted to check back on the progress for this issue.  Also thought some images might help.  These tree1 and 2 images show the desktop application that we use and shows how its scale function works.  This is the same type of functionality I'm looking for in the Silverlight tree view.

    The SilverlightTree1 and 2 images show the functionality of setting the scale transform on the RadTree itself, which is not correct.

    Thanks,
    Michael
  4. Answer
    Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 06 Feb 2010 Link to this post

    Hello Michael,

    We sorry for the late response.

    In order to zoom in and zoom out the tree control we are recommending to use our LayoutTransformControl. In the attached example we are binding its LayoutTransform property and this way scaling the tree items.

    Please try the attached example and let us know if we can assist you.

    All the best,
    Ivan
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  5. Timothy Garton
    Timothy Garton avatar
    14 posts
    Member since:
    Sep 2009

    Posted 10 Feb 2010 Link to this post

    That did it.  I knew the solution would be simple when I saw it, but I can say I never would have figured it out on my own.

    Thanks for your help,
    Michael
Back to Top