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

CheckedItems only return root item

4 Answers 42 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
question_forum
Top achievements
Rank 1
question_forum asked on 07 Jan 2010, 03:37 PM
Hi,

I'm using RadTreeView control for WPF Q2 2009, with values

IsOptionElementsEnabled

 

="True"  

 

ItemsOptionListType="CheckList"  

 

IsTriStateMode="True"

the treeview is collapsed. If i check first root item but not expand the node, CheckedItems only return one item. Otherwise if I expand the node, CheckedItems returns the root item node and subitems.

Is there any option to avoid that?

This is the example:

 

<telerik:RadTreeView   
            IsLineEnabled="True"   
            IsOptionElementsEnabled="True" 
            ItemsOptionListType="CheckList"    
            IsTriStateMode="True" 
            IsRootLinesEnabled="True"    
 
            controls:StyleManager.Theme="Vista" 
        > 
            <telerik:RadTreeViewItem Header="Item0">  
                <telerik:RadTreeViewItem Header="Item1.1"/>  
                <telerik:RadTreeViewItem Header="Item1.2"/>  
            </telerik:RadTreeViewItem> 
            <telerik:RadTreeViewItem Header="Item1">  
                <telerik:RadTreeViewItem Header="Item1.1"/>  
                <telerik:RadTreeViewItem Header="Item1.2"/>  
            </telerik:RadTreeViewItem> 
            <telerik:RadTreeViewItem Header="Item2">  
                <telerik:RadTreeViewItem Header="Item1.1"/>  
                <telerik:RadTreeViewItem Header="Item1.2"/>  
            </telerik:RadTreeViewItem> 
 
        </telerik:RadTreeView> 

When I check node Item0 but not expand it, CheckedItems returns Item 0 only (this happens only the first time node is collapsed)
But expanding it, CheckedItems returns Item 0, Item1.1, Item1.2. (if i collapsed the node again, CheckedItems returns Item 0, Item1.1, Item1.2)

 

Also I set theme to Vista (controls:

StyleManager.Theme="Vista" ) but I get an orange backgound when mouse is over the nodes. Is this ok?

Thanks and best regards,
Alberto

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 08 Jan 2010, 01:43 PM
Hi question_forum,

This is the expected bevahior. It is actin like that because the collapsed items are still not generated. Once you expand them - they will fire the Expanded event also.

Regards,
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.
0
question_forum
Top achievements
Rank 1
answered on 11 Jan 2010, 08:20 AM
Hi Valentin,

Is there any way to expand all nodes at start? In XAML or code-behind (I prefer in XAML)?

Thanks for the response.
0
Valentin.Stoychev
Telerik team
answered on 11 Jan 2010, 08:22 AM
Hello question_forum,

Yes - check this article:
http://www.beacosta.com/blog/?p=54

Sincerely yours,
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.
0
question_forum
Top achievements
Rank 1
answered on 11 Jan 2010, 08:30 AM
Thanks a lot.

Best regards
Tags
TreeView
Asked by
question_forum
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
question_forum
Top achievements
Rank 1
Share this question
or