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

Windows Form ComboBoxAutoComplete and SetSelectedItem

I am trying to set the selected item in a combobox autocomplete control but am having no success.

Can you point me to some code or a sample project that might show how to set the selected item (ala when a user restarts an app and wants to have the last item selected appear).

I have tried SetSelectedItem, SelectedIndex and SetSelectedValue with no success.

thanks.

3 Replies

AR Anupama Roy Syncfusion Team December 5, 2006 06:09 PM UTC

Hi Allen,

Thanks for your interest in Syncfusion products.

Do you mean that you would like to persist the value you selected before closing the form and would like to get that as the selected item in the Text field when the Form loads?

Kindly let me know if I have not understood your requirement.

Regards,

Anu.



AF Allen Foster December 5, 2006 10:21 PM UTC

Yes, i'd like to persist the selected item and then, after populated the datasource for the autocompletecontrol, restore the selected item


AR Anupama Roy Syncfusion Team December 6, 2006 06:14 AM UTC

Hi Allen,

You can make use of AppStateSerializer class in order to persist values.Please take a look at the sample attached and let me know if you have any difficulties to follow.

Sample

Sample shows the Loading and Saving of items under a button click event.Instead of this,you can use Form Load event and Form Closing event in order to Save and Load Selected items automatically.


Kindly let us know if this does not meet your requirement.

Best Regards,

Anu.

Loader.
Live Chat Icon For mobile
Up arrow icon