Hi,
I'm binding the ItemSource with ListCollectionView ....I noted that changing the selection on TreeListView the CurrentItem is not updated. Also the MoveCurrentTo method doesn't work. I use the some procedure with RadGridView and works fine!
How I can resolve this issue?
9 Answers, 1 is accepted
Hi Simone,
The reason for this difference in behavior is that the RadTreeListView internally generates a HierarchicalCollectionView, while the RadGridView uses a QueryableCollectionView. Currently, the former does not support synchronization with its current item through the CollectionView API, even though synchronization with the selection should be available.
With that said, I've prepared a small sample project which demonstrates how to move the current item by actually changing the SelectedItem of the control.
Please have a look and let me know if a similar approach would work for you.
Regards,
Dilyan Traykov
Progress Telerik
Hi Dilyan,
Thanks for your support. I noted that you have a single type WarehouseItem for WarehouseItems and Items. I've already used your approach but I have two different type for ItemSources and Items... Can be this the problem? Is there a workaround for this issue?
Hi Simone,
The RadTreeListView control should only be used when dealing with homogeneous data. If you have different types for the ItemsSource and those objects' child items, you'd better use a RadTreeView or a hierarchical RadGridView control.
Please let me know whether switching to any of these controls will be possible for you.
Regards,
Dilyan Traykov
Progress Telerik
Hi Dilyan,
I prefer to stay with the current data structure, why the other components I don't get what I expect. Do you have any other workaround? Will there be an update of the component?
Thank you very much!
Hi Simone,
I'm afraid that the RadTreeListView control is designed to work with homogeneous data and some of its functionality may not behave as expected if using a heterogeneous source. You can have a look at the following thread which discusses a similar requirement.
Unfortunately, we do not have any plans for introducing support for such a source. If you would, however, provide more details on your current setup and exact requirement, I'd be more than happy to try and suggest a viable solution for your particular scenario.
Regards,
Dilyan Traykov
Progress Telerik
Hi Dilyan,
Thanks in advance for your help. In attached you can find an example of my project, please take a look and let me know if you have any suggestion.
Rename the RadTreeListView.jpg as RadTreeListView.zip for the source code :)
Hi Simone,
Thank you for the provided project.
The suggested approach of binding the SelectedItem property seems to work fine in the attached project. I've updated the sample project to demonstrate this approach in this setup.
Can you please have a look and let me know if something similar would work for you?
Regards,
Dilyan Traykov
Progress Telerik
Hi Dilyan,
The big problem is that is not possible to navigate in the grid with the keyboard. Also in your project is not possible to do this.
Hi Simone,
This behavior is once more caused by the heterogeneous source which is provided and the difference between the types of the Desk and Book objects.
A simple fix for achieving the desired behavior, however, is to have the Book class inherit from Desk:
public class Book : Desk
Regards,
Dilyan Traykov
Progress Telerik