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

Items disappear when collapsed

3 Answers 129 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 15 Apr 2011, 08:03 PM
Hi. I'm using the WPF RadTreeListView with EnableRowVirtualization = false and EnableColumnVirtualization = false. I hook the TreeListViewRow's IsExpandedChanged event and, in the handler, I go through all the RadTreeListView's Items. Ultimately, I want to get the item containers (the TreeListViewRows) for each item.

But when an row is collapsed (as opposed to expanded) all its child items disappear from RadTreeListView's Items collection! When I expand the row, the child items come back.

Even if virtualization were on, that should only affect the existance of TreeListViewRows, not the existence of Items. How do I fix this?

Thanks,
   Bob Alexander

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Apr 2011, 06:17 AM
Hello Bob,

 Indeed this is how our treelist will work on expand/collapse. When you expand child items will be added and when you collapse child items will be removed. Our hierarchical collection works with Reset action since the earlier versions with add/remove actions proved to be very very slow. 

Regards,
Vlad
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
Bob
Top achievements
Rank 1
answered on 26 Apr 2011, 02:00 PM
Hi Vlad,

Thank you (and pardon my late response; I was on vacation). What I need to do is find an item's parent, whether that item is currently visible or not (or its parent is visible or not). I was hoping to get the item's container (the TreeListViewRow), get the row's parent, then get the DataContext from that. I can't rely on the item object having a reference to its parent, because I don't have total control over the item's implementation.

So, is there a way for me to reliably find an item's parent in a RadTreeListView?

Thanks,
   Bob
0
Bob
Top achievements
Rank 1
answered on 28 Apr 2011, 03:39 PM
Is there no solution? No way for a RadTreeListView to walk its hierarchy?

- Bob
Tags
TreeListView
Asked by
Bob
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Bob
Top achievements
Rank 1
Share this question
or