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

Duplicate items in ItemSource cause blank line

1 Answer 84 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Natasha
Top achievements
Rank 1
Natasha asked on 14 May 2018, 07:59 AM

I have a scenario where I have an ordinary RadGridView and the user selects items from that grid. Those items then become the top level itemSource in the TreeListView. When Engine is selected in the main grid it is both in the top level items and it's a child of one of the other items i.e. vehicle causing a blank line to appear when expanding the child nodes.

Mat.

-Vehicle

--Engine

--Body

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 May 2018, 11:06 AM
Hi Natasha,

Thank you for the attached image.

This behavior would be the expected one. Having the same object instance added multiple times in the source collection is not recommended. Both RadGridView/RadTreeListView are data-bound components which use virtualization mechanisms for displaying their data. Each item displayed in the viewport is associated with a visual container. With this in mind, rendering multiple containers for the same object instance would not be possible. So, the only solution that I can propose you is to have a separate object instance for each child collection.

I hope I have managed to clarify your concerns. Feel free to update me in case further assistance is needed.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeListView
Asked by
Natasha
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or