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

CheckedItems is null

2 Answers 65 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 10 Jun 2010, 10:32 AM
Hi,
I'm using TreeView with the checkbox enabled

<telerik:RadTreeView MinWidth="150"  
                                     IsLineEnabled="True"  
                                     ItemsOptionListType="CheckList"  
                                     x:Name="leftTree"  
                                     IsTriStateMode="True"  
                                     IsOptionElementsEnabled="True"  
                                     ItemTemplate="{StaticResource dataTemplate}"/> 

So the basic usage:
The treeview has no checked items to begin with and is collapsed. The user should be able to check the top item.

So the problem is that I cannot iterate through the checked item collection when the tree is collapsed because the items do not exist.
Is there any way to have the items created so I can iterate through them without expending the tree.

Best regards
Kristján.

2 Answers, 1 is accepted

Sort by
0
Kristjan Einarsson
Top achievements
Rank 1
answered on 15 Jun 2010, 11:34 AM
anyone ?
0
Valentin.Stoychev
Telerik team
answered on 15 Jun 2010, 02:02 PM
Hello Kristjan Einarsson,

As you said you can't iterate through the item containers because they are still not generated.

Can you elaborate a little bit more on the problem you are trying to solve? Basically the correct implementation will be if you think of the TreeView only as a View of your data model, and to iterate not the generated treeview items, but the business objects that are used for the treeview population. This way you will have access to all the items - not only to generated containers.

Kind regards,
Valentin.Stoychev
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.
Tags
TreeView
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Kristjan Einarsson
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or