Using DisplayMember and ValueMember in Autocomplete

Posted by: stevecarmichelle1 on 28 January 2018, 10:40 pm EST

  • 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.

  • Posted 30 January 2018, 5:49 pm EST

    Hi Rajesh,

    I also tried the setting the SelectedValuePath but it doesn’t seem to be working. Please allow me to get in touch with the concerned team for review and get back to you with any update I get from them. It could be a bug or it could be related to implementation. (Tracking Id - 306442)

    Thanks for bringing this to our attention.

  • Posted 7 February 2018, 7:40 pm EST

    Hi,

    Any updates on this please. Without this feature it means that we can not use this control for new as well as modifying existing data that is already saved to db.

    Thanks,

  • Posted 8 February 2018, 6:00 pm EST

    Hi Rajesh,

    This issue has been fixed by the development team but the build is still under testing. You can check the next released build for this fix on Nuget.

  • Posted 1 April 2018, 11:39 pm EST

    Hi Rajesh,

    The fixed build (2.5.20181.267) is available on Nuget. Kindly update your application with this build.

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels