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

Set the TreeListViewItem visibility

2 Answers 59 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
wang
Top achievements
Rank 1
wang asked on 24 Jul 2019, 10:23 AM

Can i set the TreeListViewItem visibility to visible or hide, when i use the treelistiview in Virtualization model.

I want to use this method to search something,or may be another?

2 Answers, 1 is accepted

Sort by
0
Dimitar Dinev
Telerik team
answered on 24 Jul 2019, 03:56 PM
Hi Wang,

It is not recommended to modify the rows' visibility as it will most likely result in the appearance of blank spaces into your TreeListView or other unpredictable behavior. I wouldn't suggest working with the visual elements when the control is virtualized due to the containers recycling mechanism. Please, take a look at the UI Virtualization article.

What I can suggest is to utilize a filtering approach to determine which items should be visible.

Attached, you can find a sample project in which I've demonstrated this approach. What I've done is I added a IsVisible property which determines whether an item should be visible and not setting a Visibility directly. Please, review the project and let me know if you find it helpful.

Regards,
Dimitar Dinev
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
wang
Top achievements
Rank 1
answered on 25 Jul 2019, 01:44 AM

OKļ¼Œthanks a lot , I will try it . 

Tags
TreeListView
Asked by
wang
Top achievements
Rank 1
Answers by
Dimitar Dinev
Telerik team
wang
Top achievements
Rank 1
Share this question
or