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.

ComboBoxAdv autocomplete with DropDownList

Thread ID:

Created:

Updated:

Platform:

Replies:

53676 Dec 18,2006 03:19 PM Jan 2,2007 11:01 PM Windows Forms 5
loading
Tags: Tools
Julie Levy
Asked On December 18, 2006 03:19 PM

Hi -
How do i get autocomplete behavior with ComboBoxAdv with the style set to DropDownList? The user has to be limited to the choices in the bound datasource.
I just upgraded to 4.4 and noticed an autocomplete property exists, but i don't get the autocomplete behavior unless the style is dropdown.
Thanks,
Julie

Anupama Roy [Syncfusion]
Replied On December 19, 2006 12:40 PM

Hi Julie,

Though ComboBoxAdv supports AutoComplete,it does not allow you to have any customizations with regard to AutoComplete.In earlier versions also ComboBoxAdv was supporting an internal AutoComplete.However,some of our customers wanted an option to disable the AutoComplete functionality and for that,in 4.4 we have added an AutoComplete property which you have noticed.

You can go for the ComboBoxAutoComplete control which supports more AutoComplete functionalities or you can use the AutoComplete component on a windows comboBox control.

Please feel free to get back to us if you need more information on this.

Best Regards,

Anu

Administrator [Syncfusion]
Replied On December 19, 2006 03:27 PM

Hi -
thanks for your response.
I'm not trying to get any custom behavior, just standard autocomplete behavior when the style is DropDownList. We use the ComboBoxAdv control instead of the windows control because of it's flat visual style options and border color property.
Is there a combobox control where we can get the same control over the look of the combobox and get autocomplete behavior with style dropdownlist?
Thanks,
Julie

Anupama Roy [Syncfusion]
Replied On December 20, 2006 06:33 AM

Hi Julie,

If the reason you want to go for a DropDownList style is to prevent invalid entry,then you can handle the TextChanged event of ComboBoxAdv and do a validation as shown below.Here it clears the value if it is not there in the list.

private void comboBoxAdv1_TextChanged(object sender, System.EventArgs e)
{
if(-1==this.comboBoxAdv1.FindStringExact (this.comboBoxAdv1.TextBox.Text,true))
{


this.comboBoxAdv1.TextBox.Clear ();

}
}

Kindly let us know if you need further assistance.

Download Sample

Best Regards,

Anu.


Administrator [Syncfusion]
Replied On December 22, 2006 02:01 PM

Hi -
thanks for the response. However, clearing the text is not very user friendly. What i really need is to duplicate the normal autocomplete behavior and ignore the nonmatching text change, leaving whatever the user has correctly typed in (with the autocomplete filled in). So the event i really need is TextChanging (so i can cancel), not TextChanged.
I don't see that exposed.
Any other ideas?
Julie

Anupama Roy [Syncfusion]
Replied On January 2, 2007 11:01 PM

Hi Julie,

Sorry for the delay in getting back to you.

Currently we do not have a TextChanging event that can be canceled for non matching Text.Handling TextChanged event was just a workaround and I am sorry that it does not fulfill your exact requirement of having DropDownList style.

Thank you for your patience.

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.

;