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

Setting Datasource property of AutoComplete control does not show the drop down

Hi,
I am using AutoComplete component. Please see the below code snippet:

List dests = new List( new string[] { "Dest1", "Dest2", "Dest4", "Dest3", "Dest5"});
autoCompleteDest.SetAutoComplete(textbox1, AutoCompleteModes.Both);
autoCompleteDest.Datasource = dests;

No when I type something (starting with 'D') in the textbox1, the drop down does not appear. I tried setting AutoCompleteColumnInfo() but of no use. Kinldy let me know how to use this control with a list of strings and objects. Thanks

I am using Syncfusion version 6.302.0.30.

Regards
Kiran



5 Replies

FA Faltu August 4, 2008 05:16 PM UTC

Hi,

The scenario is like this - Textbox is part of a UserControl (say UC1). If this UC1 is child of Form, then it works fine. If this UC1 is child of another UserControl (say UC2) and this UC2 is the child of Form, then AutoComplete does not work.

Kindly let me know how to resolve this. Thanks.

Regards
Kiran



FA Faltu August 4, 2008 06:08 PM UTC

The autocomplete component is part of UC2 and not part of Form. This is the situation it is not working.

So When the autoComplete is part of usercontrol rather than the form then it does not work.

Let me know the solution for this. Thanks.

Regards
Kiran




AD Administrator Syncfusion Team August 6, 2008 06:46 AM UTC

Hi Kiran,

Thank you for your interest in Syncfusion Products.

When AutoComplete control is used in a UserControl, the parent form of the UserControl has to be set to the ParentForm property of the AutoComplete control as shown below:

private void UserControl1_Load(object sender, System.EventArgs e)
{
this.autoComplete1.ParentForm = this.ParentForm;
}

If you do not implement the above given code snippet,then AutoComplete will not read the Datasource that is set in UserControl .

Please refer the following sample as per your requirement.
http://websamples.syncfusion.com/samples/Tools.Windows/F75618/main.htm


Please refer to this KB article and tutorial link for more clarifications.
KBArticle

http://www2.syncfusion.com/ug_63/toolswin/EmbeddingAnAutoCompleteControlInAUserControl.html

Please let me know if you need more assistance.

Thanks for your patience.

Regards,
Hema



FA Faltu August 6, 2008 05:19 PM UTC

Thanks
Kiran



AD Administrator Syncfusion Team August 7, 2008 10:16 AM UTC

Hi Kiran,

Thank you for the update.

Regards,
Hema


Loader.
Live Chat Icon For mobile
Up arrow icon