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

Issue with IsExpanded and Selected item with MVVM

3 Answers 220 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 16 Dec 2014, 08:15 PM
I have two issues with the RadTreeListView control. 

1)Performance sucks on the UI load for the expansion of rows with MVVM. The issue I have is I maintain the state of the collapsed and expanded nodes. Let's say my Nodes are all expanded. I set my datasource.
The control draws them all collapsed, then "pops" then expands them all. Looks like crap. i.e. I do a "refresh" on my datasource and reset the collection and all the items collapse then expand again. Looks pretty bad.


2) I spent hours trying to figure this out to no avail. I am refreshing my datasource and I tried to ways to set my selected item. 
1) using the IsSelected property. Which should have been good enough since I store that value and load it with my objects. (And yes, I had the row databinding style which would have been nice if you had that supported like the IsExpandedBinding property)
2) Setting my SelectedItem property on my VM. Which is bound two way to the grid.

I set it before. I set it after the ItemSource update. I always just get the first item in the dataset to appear selected.

I am using an observablecollection for the ItemsSource.

Maybe I am missing something obvious, but the control isn't feeling very solid to me so far.





3 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 17 Dec 2014, 11:25 AM
Hello Brian,

Let me answer your questions one at a time:
1) The problem here is that the data structure behind RadTreeListView is constructed dynamically based on the Load on Demand approach. This ensures minimal memory consumption with large hierarchies. Since the Binding can only be evaluated on loaded items it looks as if the hierarchy is expanding runtime. 

2) The same goes here. You can select Items that are currently loaded in the Items collection. Selecting item that is located in a non-expanded branch(at least one expansion needed) won't work. 

Hope this makes sense. 


Regards,
Nick
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brian
Top achievements
Rank 1
answered on 17 Dec 2014, 03:12 PM
Good morning,

This seems like a pretty major oversight for supporting heirarchical lists in an MVVM environment. Technically any environment where you open and load to expanded nodes.

Is there a way to turn off the load on demand and just load it all at once? 

I wrote a custom treelistview for a client a while back due to the limitations of all the existing WPF TreeList View controls. I was hoping to have my current client be able to use yours since they like Telerik products. The popping effect is abysmal and the lack of selection support is even worse. Think of a refresh. Keeping the same scroll position and selected item is pretty key. Link navigation that selects an item in the tree. etc. 
0
Nick
Telerik team
answered on 19 Dec 2014, 02:10 PM
Hello Brian,

I completely understand your frustration. We have planned major upgrades in terms of data processing and are hoping they will cover the most delicate scenarios.
Unfortunately since this is a huge change on our side in both implementation and integration aspects, I cannot commit to a certain time frame as to when the changes will be publicly available. 

Regards,
Nick
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeListView
Asked by
Brian
Top achievements
Rank 1
Answers by
Nick
Telerik team
Brian
Top achievements
Rank 1
Share this question
or