Working With Search Bar

Dheeraj Kumar Gunti

Reading Time : ( words)

If we have huge data and looking for certain item will be complicated. So we should have search concept for our list of items which filters data based on the key entry.

Here is the small sample which users UISearchBar for searching the data in a table.

- Create a new solution with one View Controller.

- Add a Search bar and TableView to the Controller as shown below.

For this sample we are using a list of countries which will be shown in the table and we will filter them based on the key entry.

- Create a TableSource.

- Bind the Table Source to the UITableView.

ItemsTableView.Source = new TableSource (Names);

- Write the below events for the UISearchBar to filter the data.

Enjoy Coding...