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

There are a bug in treeview,is it right?Select the first parent,but the treeview shows nothing selected!

5 Answers 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
PEIYANG
Top achievements
Rank 1
PEIYANG asked on 10 Jul 2012, 02:20 AM
For Example,I have a treeview ,it has 2 notes called China And America,China have 2 child notes called Beijing and GuangXi,They are all collapsed,WHen I select  China ,the treeview's checkitems.count=0;but when I expand it and then select China,its count=2.I added the treeview in a combox,and all treeview node has a checkbox,is it the reason affect treeview?

5 Answers, 1 is accepted

Sort by
0
PEIYANG
Top achievements
Rank 1
answered on 10 Jul 2012, 06:18 PM
This result called lazy load,How can I to reslove it?
0
Petar Mladenov
Telerik team
answered on 12 Jul 2012, 11:31 AM
Hi PEIYANG ,

 The RadTreeView generates its containers - the RadTreeViewitems when they are:
1) Root Level Items
2) Non-Root Item but their parent is Expanded
I guess you use TriState mode of the RadTreeView with setting the IsInTriStateMode = True. If so, when you check a root level Item which has never been expanded, only it will be in the CheckedItems Collection. In other words its children cannot be in the CheckedItems since they are not generated yet.
Could you please elaborate more on your scenario? It's not a good idea to use the CheckedItems collection because it has some known issues.

Regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
PEIYANG
Top achievements
Rank 1
answered on 13 Jul 2012, 12:49 AM
If I set IsInTriStateMode = false,so it can not be lazy load??
0
PEIYANG
Top achievements
Rank 1
answered on 13 Jul 2012, 12:57 AM
what is the meaning of IsInTriStateMode ?
0
Petar Mladenov
Telerik team
answered on 17 Jul 2012, 06:20 AM
Hello PEIYANG,

TriStateMode should be used only in static scenarios (RadTreeViewItems are defined in XAML (not via binding)) and means that when a parent not is checked all of its children are checked too. If some of the children are checked and some a unchecked, the parent is in Indeterminate state. If all children are unchecked the parent is unchecked too.
In databinding scenarios, due to some known limitations in RadTreeView, this property won't work as expected. So we highly suggest you to use the approach described in this help article.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
PEIYANG
Top achievements
Rank 1
Answers by
PEIYANG
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or