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

ItemContainerGenerator returns null when item is collapsed

3 Answers 126 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lauren Nickerson
Top achievements
Rank 1
Lauren Nickerson asked on 08 Apr 2010, 03:02 AM
As the title says, the item exists within the RadTreeViewItem.Items, yet it returns null, even when searching by index, see the following screen shot:


The RadTreeView is data bound using several HierarchyDataTemplates, I tried this with regular items like so:

        <telerik:RadTreeView> 
            <telerik:RadTreeViewItem x:Name="firstTelerikItem" Header="Item 1" IsExpanded="True"
                <telerik:RadTreeViewItem Header="Item 1.1" x:Name="containerTelerik1_1" /> 
                <telerik:RadTreeViewItem Header="Item 1.2" x:Name="containerTelerik1_2" /> 
                <telerik:RadTreeViewItem Header="Item 1.3" x:Name="containerTelerik1_3" /> 
            </telerik:RadTreeViewItem> 
            <telerik:RadTreeViewItem Header="Item 2" /> 
            <telerik:RadTreeViewItem Header="Item 3" /> 
        </telerik:RadTreeView> 

And in there it works fine, but not with the databound ones.

Lmk, thanks!

3 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 08 Apr 2010, 09:42 AM
Hi Lauren Nickerson,

Yes - this is the expected behavior - the container is not used and is null.

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.
0
Lauren Nickerson
Top achievements
Rank 1
answered on 08 Apr 2010, 07:27 PM
I see, is there any work around to get the container when the parent item is collapsed?
0
Valentin.Stoychev
Telerik team
answered on 12 Apr 2010, 01:50 PM
Hello Lauren Nickerson,

You can't get the container beucase it do not exist. Please let us know what is your scenario so we can give you some advise.

Sincerely yours,
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
Lauren Nickerson
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Lauren Nickerson
Top achievements
Rank 1
Share this question
or