TreeView (does not collapse when hinding node)

4 posts, 0 answers
  1. Amit
    Amit avatar
    4 posts
    Member since:
    Mar 2009

    Posted 09 Nov 2010 Link to this post

    Hello,
    Seems to be facing two probelms with RadTreeView:

    1)  When hinding a node in TreeView, nodes space is not collapsed. it hide the node but keep the space there.
    2) Collapse and expand method on node does not seems to work.

    Can you guys test to see if this is working on your part, if so please provide the example how you are achiving it?

    Thanks,
    Amit

    Node1
        node1.1
        node1.2
    Node2 ---------->calling collapse method on this node would nto collapse node.
        node2.1
        node2.2
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Nov 2010 Link to this post

    Hi Amit,

    I am not really sure what is your scenario, but if in your first point you are referring to setting a Visibility to teh RadTreeViewItems, then I wanted to ask you to try and set the RadTreeViewItems ItemsPanel to a StackPanel, like so:
    <Style TargetType="telerik:RadTreeViewItem">
        <Style.Setters>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <StackPanel />
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style.Setters>
    </Style>
    As for your other point, can you please elaborate on your scenario and how you use the Expand and Collapse methods. You can also check out this demo http://demos.telerik.com/silverlight/#TreeView/FirstLook and examine its source code.

    Let us know how it goes.

    Best wishes,
    Petar Mladenov
    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
  3. DevCraft banner
  4. Amit Patel
    Amit Patel avatar
    71 posts
    Member since:
    Sep 2009

    Posted 10 Nov 2010 Link to this post

    Thanks for the replay!
    I will try out the stack panel option. For collapsing I am doing everything via binding, using MVVM pattern.

    Thanks,
    Amit
  5. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 29 Aug 2011 Link to this post

    Should be

    <Style TargetType="telerik:RadTreeView">  
        <Style.Setters>  
            <Setter Property="ItemsPanel">  
                <Setter.Value>  
                    <ItemsPanelTemplate>  
                        <StackPanel /> 
                    </ItemsPanelTemplate>  
                </Setter.Value>  
            </Setter>  
        </Style.Setters>  
    </Style>
Back to Top