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

RadTreeListView not sync with ICollectionView

9 Answers 136 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Simone
Top achievements
Rank 1
Simone asked on 25 Oct 2019, 11:44 AM

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

Sort by
0
Dilyan Traykov
Telerik team
answered on 30 Oct 2019, 11:16 AM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simone
Top achievements
Rank 1
answered on 31 Oct 2019, 07:48 AM

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?

0
Dilyan Traykov
Telerik team
answered on 01 Nov 2019, 03:25 PM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simone
Top achievements
Rank 1
answered on 04 Nov 2019, 02:15 PM

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!

0
Dilyan Traykov
Telerik team
answered on 05 Nov 2019, 12:37 PM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simone
Top achievements
Rank 1
answered on 13 Nov 2019, 12:34 PM

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 :)

0
Dilyan Traykov
Telerik team
answered on 15 Nov 2019, 12:51 PM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simone
Top achievements
Rank 1
answered on 20 Nov 2019, 07:00 AM

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. 

0
Dilyan Traykov
Telerik team
answered on 20 Nov 2019, 02:57 PM

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
I do hope you find such an approach applicable.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeListView
Asked by
Simone
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Simone
Top achievements
Rank 1
Share this question
or