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.

Windows Form ComboBoxAutoComplete and SetSelectedItem

Thread ID:

Created:

Updated:

Platform:

Replies:

52789 Dec 4,2006 01:23 PM Dec 6,2006 01:14 AM Windows Forms 3
loading
Tags: EditControl
Allen Foster
Asked On December 4, 2006 01:23 PM

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.

Anupama Roy [Syncfusion]
Replied On December 5, 2006 01:09 PM

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.


Allen Foster
Replied On December 5, 2006 05:21 PM

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

Anupama Roy [Syncfusion]
Replied On December 6, 2006 01:14 AM

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.

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.

;