We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to implement search inside a picker

Thread ID:

Created:

Updated:

Platform:

Replies:

132916 Sep 28,2017 05:46 AM Oct 6,2017 10:16 AM Xamarin.Forms 3
loading
Tags: SfPicker
Rajesh
Asked On September 28, 2017 05:46 AM

Hi

I would like to know if it is possible to search within a picker.

For example I am using the picker to populate all the states of the US in ascending order (2 characters only).

And I want to select WA which will be at the bottom of hte picker. Is there any way to use the keyboard within the picker to narrow down the search and select it.

Thanks,

Rajesh.

Praveen Koildasan [Syncfusion]
Replied On September 29, 2017 09:07 AM

 Hi Rajesh , 
Thank you for contacting syncfusion support. 
Currently we don’t have built-in support for your requirement in SfPicker control. We have prepared a workaround sample based on your mentioned scenario . As per your example scenario mentioned in the incident we have created picker sample with states of US in ascending order. For performing the search option we have added a Entry as a custom view to the header of the picker. We have used  TextChanged event  to get the state name  and  checked Entry text with the picker items . If both matched , finally we have changed the SelectedIndex property to matched item. 
Please find the sample from the below link. 
Please go through the sample and if it does not meet your requirement, update us with detailed specification of your requirement to analyze further and provide an appropriate solution. 
Regards, 
Praveen Koildasan. 


Rajesh
Replied On October 2, 2017 01:37 AM

Hi Praveen,

Thanks for the reply and it was what I needed to achieve in a picker.

But I have some queries regarding the design and behavior of the picker in a real time environment. Would like to hear a solution how to achieve the behavior as explained below.

The default look should be similar to an Entry with the word "Select one". That gives the user the hint that he needs to tap it to select a value. The picker popups.

On displaying, it should be similar to the attached images. The height large enough to display multiple values without scrolling a lot. And on selecting a value and tapping OK the value is passed back to the parent form and displayed. The final outcome is in the image "Output after entering the city and selecting the State".

Also the display colors and font size need to be large enough on a 5.5" device (both Android and iOS)

The above task was achieved using a custom control (popup control, search control and a listview control).

Thanks,

Rajesh


Attachment: SFPickerWithSearch_970b1a9c.rar

Eswaran Thirugnanasambandam [Syncfusion]
Replied On October 6, 2017 10:16 AM

Hi Rajesh,

Thanks for your update.

In our current implementation we don’t have support for “ Searching functionality in sfPicker control”. We have logged feature for this and the feature will be available in any of our upcoming release. Based on your requirement we have prepared a sample for searching the item in the SfPicker items as a workaround. Please find the sample from the below link

Link: http://www.syncfusion.com/downloads/support/forum/132916/ze/Picker_sample511157100  

Please let us know if you have any other query.

Regards,
Eswaran AT. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;