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

TreeView (does not collapse when hinding node)

3 Answers 79 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 09 Nov 2010, 04:55 PM
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

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 10 Nov 2010, 06:08 PM
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
0
Amit Patel
Top achievements
Rank 1
answered on 10 Nov 2010, 08:06 PM
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
0
Murray
Top achievements
Rank 2
answered on 29 Aug 2011, 07:38 PM
Should be

<Style TargetType="telerik:RadTreeView">  
    <Style.Setters>  
        <Setter Property="ItemsPanel">  
            <Setter.Value>  
                <ItemsPanelTemplate>  
                    <StackPanel /> 
                </ItemsPanelTemplate>  
            </Setter.Value>  
        </Setter>  
    </Style.Setters>  
</Style>
Tags
TreeView
Asked by
Amit
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Amit Patel
Top achievements
Rank 1
Murray
Top achievements
Rank 2
Share this question
or