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. Image for the cookie policy date
close icon

Get selected value from DataSource

I set a List<object> to the DataSource property of a SfAutoComplete control,

How can I retrieve the value once the value is selected?
I'm only able to get the displayed text value (with Text property), but not the object which is refering to.

5 Replies

CP Chozarajan Pandiyarajan Syncfusion Team October 27, 2016 12:37 PM UTC

Hi Lan,

Thanks for contacting Syncfusion Support.

Query: How to get the selected value from AutoComplete when DataSource property set.

We have created a simple sample as per your scenario. Please downloaded from the below link.

Link: http://www.syncfusion.com/downloads/support/forum/127114/ze/AutoComplete_Data242290850 

Please let us know whether given sample meets your requirement. If not update us with more details.

Regards,
Chozarajan P

 



JO John October 30, 2016 07:38 AM UTC

Hi Chozarajan

I've looked at the solution in the link supplied, when selecting from the dropdown for the first time the autoComplete.SelectedIndex shows 0 , on every subsequent selection, the dropdown shows the previously selected item and not the currently selected item. 
is that the correct expected behaviour, and if so, what would be the best way to get the currently selected item? 




PK Pavendhan Kumar Syncfusion Team October 31, 2016 07:30 AM UTC

Hi Stephanie,

Thank you for your update.

SelectedIndex value starts from zero in nature. So whenever your are selecting the first item it will display one index less than actual. We have modified the sample for your convenience.please download the same from the following link.

Link: http://www.syncfusion.com/downloads/support/forum/127114/ze/AutoComplete_Data1286023421 

Please let us know whether the given sample meets your requirement or not.

Regards,
Pavendhan K. 



JO John October 31, 2016 11:35 PM UTC

Hi, thanks for the updated example.

I've included a few screenshots to demonstrate the steps to recreate the issue as experienced in the ios version

Image 1 
Selected 'aseka' and the selected value is displaying as empty while it should be 'AKT'

Image 2 
Selected 'akabe' and the selected value is displaying 'AKT' from previous selection while is should be 'SSKV'

Attachment: Images_fdf3ec66.zip


PK Pavendhan Kumar Syncfusion Team November 1, 2016 10:32 AM UTC

Hi Stephanie,

Sorry for the convenience caused.

We were able to reproduce the reported issue "SelectedValue and SelectedIndex properties returns wrong values" at our end. And we have logged a bug report regarding the same.A support incident to track the status of this defect has been created under your account.

Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/  

Regards,
Pavendhan K.  


Loader.
Live Chat Icon For mobile
Up arrow icon