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

AutoComplete with external DataSource

I'm trying to create a control derived from TextBox that has a preset AutoComplete history list implemented as an ArrayList passed to the AutoComplete's DataSource property. My arraylist has two "columns" (properties on each object in the arraylist), and the documentation seems to indicate that the first column will be used for matching, and both columns will be displayed in the dropdown list. But I'm not having any luck getting the list to drop down. Please see the attached test project. Thanks in advance... mike

2 Replies

DJ Davis Jebaraj Syncfusion Team June 1, 2002 12:15 AM

> I'm trying to create a control derived from TextBox that has a preset AutoComplete history list implemented as an ArrayList passed to the AutoComplete's DataSource property. My arraylist has two "columns" (properties on each object in the arraylist), and the documentation seems to indicate that the first column will be used for matching, and both columns will be displayed in the dropdown list. But I'm not having any luck getting the list to drop down. Please see the attached test project. > > Thanks in advance... > mike Hi Mike, The ArrayList data source you have used in the sample project fails to show the expected result on account of the following issues: 1. The ArrayList data source is treated as a IList based data source and the AutoComplete control will only pouplate its list with the object inserted into the ArrayList by calling the object's ToString() method and therefore the result would be that you would have 20 instances of the string "AutoCompleteItem" inserted into the list control. This also implies that you have to specify a DataTable based data source in order to support multiple columns of data. 2. There is a bug in the current version of the AutoComplete control that prevented even the above scenario from happening. This bug only appears when the data source is a IList based source and not a DataTable I have added a function to your sample application that converts the array list based data source to a DataTable and attached the file. The above mentioned bug will be fixed in the next release of Essential Tools. The documentation for the AutoComplete control will also be revamped in these areas. Thank you for your patience and cooperation. Regards, Davis


MP Mike Powell June 7, 2002 06:35 AM

Thanks for the help Davis. That should work fine.

Loader.
Live Chat Icon For mobile
Up arrow icon