Posted 28 January 2018, 10:40 pm EST
Hi,
I have the following scenario in my application. The Autocomplete control is bound to a DataSource and I am using 2 different columns for the DisplayPath and the SelectedValuePath.
autoComplete.DisplayMemberPath = “Value”;
autoComplete.SelectedValuePath = “Code”;
Let us take this as an example.
Code - M
Value- Male
Code - F
Value - Female
The autocomplete control displays Male and Female in the drop down but when selecting and saving the data in the database I use the code so that the value saved in the database is M instead of Male or F instead of Female.
Now I have the following situation. When retrieving the values from the SQLite database, how do i set the selected value of the autocomplete control back to Male. I would like to know how to compare the value from the database with the Datasource and set the text.
In my application all the autocomplete controls are bound to the Datasource in the onAppearing() event and my code to populate the data from the database is in a custom method that is called after the onAppearing() event.
Would appreciate if you can give some hints how to set the value in the autocomplete control based on the data in the database.
Thanks,
Rajesh.