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

how to implement a searchbar on a listview

2 Answers 133 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Hernando
Top achievements
Rank 1
Iron
Hernando asked on 24 Jan 2019, 06:34 AM

Hi,

I am using  a listview to display a lot of data at the moment, users can multiselect items, I need to add a search bar on the top to filter the data. It must filter the data in the listview in realtime as the user is entering data on the search bar and allow to select multiple items.

Whats the best to do this, using the filter in the listview or using AutoCompleteView ? 

 

Thanks for your help.

 

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 24 Jan 2019, 02:56 PM
Hello Hernando,

I would suggest you use AutoCompleteView filtering mechanism and present the filtered results inside the ListView.  You would need to set ShowSuggestionView of the AutoCompleteView to false, so that the popup containing the results wouldn't be shown and bind the ItemsSource of the ListView to the FilteredItems collection of the AutoCompleteView.

I have created a quick example to demonstrate you how this would work, please download the attachment and give it a try.

I hope this would be helpful.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Hernando
Top achievements
Rank 1
Iron
answered on 06 Feb 2019, 08:57 AM
this is perfect thank you . 
Tags
ListView
Asked by
Hernando
Top achievements
Rank 1
Iron
Answers by
Yana
Telerik team
Hernando
Top achievements
Rank 1
Iron
Share this question
or