Changing the way a treeview node expands

3 posts, 0 answers
  1. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 10 Oct 2009 Link to this post

    Hello

    Since I was finally able to build the treeview as I wanted, I am now in the process of styling it.

    I can manage to set backgrounds visual states and other properties, but there's one thing I cannot figure out.

    My treeview has a maximum of 3 levels.
    What I'd like to do is the following :

    One single click on the first level will expend normally, behind with a slight indentation.

    Among the children of this node, I may have another sublevel that can expend. I'd like this level to expend also on single click, but on the right, align to it's parent node, kind of like any windows application menu. I hope I'm clear enough.

    I'm using a single hierarchicalDataTemplate for each level.

    Does anyone knows of a way to do that ?
  2. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 10 Oct 2009 Link to this post

    Second trick question

    Assuming that I have for instance 5 Main RadTreeviewItem, with each an unknown number of children.

    The Treeview is bound to a IList retreived from WCF.

    How do I, for each main treeviewItem, set a different style, with its own background and visualstate over behaviour.

    I'm not talking about styling level1, level2 and level3, but level1-A with style 1, level1-B with style B...
  3. DevCraft banner
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 14 Oct 2009 Link to this post

    Hi Subileau Pascal,

    The answer to both your questions is called - ItemContainerStyle. You can read more on this here:
    http://www.drwpf.com/blog/Home/tabid/36/EntryId/32/Default.aspx

    It is for WPF, but the same will apply for Silverlight.

    Greetings,
    Valentin.Stoychev
    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.
Back to Top