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.

Listbox and/or simple combobox with autocomplete support

Thread ID:

Created:

Updated:

Platform:

Replies:

26256 Mar 17,2005 01:09 PM Apr 21,2005 12:08 PM Windows Forms 7
loading
Tags: Tools
Morgan Lord
Asked On March 17, 2005 01:09 PM

I''m in dire need of a listbox and/or simple style combobox that can support autocomplete. Do you have a windows form control that will show the list by default but also supports autocomplete? (pretty much like the simple style combobox provided by .net framework). I would also like it to support setting the DataSource property to a DataTable. I don''t want the user to have to click the dropdown arrow to show the list. But I do want them to narrow down the choice through an edit box. BTW: I tried using the syncfusion ComboBoxAutoComplete control and it pretty much give me what I need except not in the simple style where the listbox is always showing. Thank You. Morgan - New Customer Gift of Hope Organ & Tissue Donor Network

Administrator [Syncfusion]
Replied On March 18, 2005 03:08 PM

Hi Morgan, I''m currently investigating whether or not this is possible through an extension of the AutoComplete class. If not, I''ll enter this as a Feature Request. Regards, Gregory Austin Syncfusion Inc.

Morgan Lord
Replied On April 12, 2005 11:26 AM

Hi Gregory, Do you know what the status of this might be? I''m in need of a combobox with an edit field that can filter based on what is typed in the edit field. It needs to support binding to a datatable/dataview. Thanks. >Hi Morgan, > > I''m currently investigating whether or not this is possible through an extension of the AutoComplete class. If not, I''ll enter this as a Feature Request. > >Regards, >Gregory Austin >Syncfusion Inc.

Administrator [Syncfusion]
Replied On April 12, 2005 04:37 PM

Hi Morgan, I apologize for the delay in responding. I''ve created a sample that demonstrates how to wire a TextBox, a ListBox, and an AutoComplete together to simulate a simple ComboBoxAutoComplete. I hope it meets your requirements. If you have any questions regarding how it functions or require help converting it into a UserControl, please let me know. Regards, Gregory Austin Syncfusion Inc.

Morgan Lord
Replied On April 20, 2005 12:23 PM

Thanks Gregory, I looked through the example and tried implementing it. I haven''t got it working yet. I did notice that the example uses a textbox in combination with a listbox. I''m using a combox with the style set to simple. I tried conforming it to my program by modifying the AutoCompletExt class''s GetList method to accept my combobox''s datasource which is a dataview of the current data with no filter set instead of having the PopulateListWithMatches method use it''s own internal history cache. When I run my program and the combobox''s textchanged event is fired. The result is that the dataview implements the filter but the numbers of rows returned equals zero. It doesn''t seem to be returning back the correct filtered dataview after the PopulateListWithMatches executes. Could you please send me a new sample that illustrates using a combobox with the style set to simple and the PopulateListWithMatches method using an external datasource. If I have the understanding of all this wrong please let me know. Thank you for your help. Morgan >Hi Morgan, > > I apologize for the delay in responding. I''ve created a sample that demonstrates how to wire a TextBox, a ListBox, and an AutoComplete together to simulate a simple ComboBoxAutoComplete. I hope it meets your requirements. If you have any questions regarding how it functions or require help converting it into a UserControl, please let me know. > >Regards, >Gregory Austin >Syncfusion Inc. > > > > >

Administrator [Syncfusion]
Replied On April 20, 2005 01:44 PM

Hi Morgan, I apologize for any confusion my sample might have caused. Please allow me to clarify the situation. AutoComplete does not work correctly with a simple style ComboBox. This is because AutoComplete overrides the ComboBox''s dropdown. A simple style ComboBox has no dropdown to override. Additionally, the DataSource of the ComboBox cannot be bound to the AutoComplete the way I bound the ListBox to AutoComplete in my sample, because every time the DataSource of the ComboBox is changed, the Text property changes, causing an infinite loop of TextChanged events. Fortunately, a ComboBox in simple style is little more than a TextBox and ListBox wired together. My sample takes advantage of this by wiring a TextBox and ListBox together in almost the same way. While different internally (i.e. you''ll have to code differently) from a ComboBox, the interface it presents to your users should be almost exactly the same. The sample I provided still requires a little work to be converted into a UserControl, and I''d be glad to answer any questions regarding that process. Regards, Gregory Austin Syncfusion Inc.

Morgan Lord
Replied On April 20, 2005 11:00 PM

Greg, Thank you for the response. I will looked into what you have said and see if wiring up a textbox and listbox like you did will work for my program manager. I had suggested something similiar to what you did but was hoping for that functionality already built into some control. Maybe Syncfusion could make this a feature request like you had suggested where you have a combobox with a simple style that filters it''s own datatable through a view. Because currently .NET''s combobox only scrolls to the row the matches what is typed. It would be nice if a property could be set to instead have it perform a filter. (I know I could write code that filters the combobox''s dataview, but it can cause issues because the .net runtime will execute code to correctly set the control''s state when binding using a datasource.) One other thing. Is it possible to modify your exmaple so that instead of the textbox adding items to the listbox that instead the autocomplete filter rows based on the prepopulated values in the datatable of the listbox''s datasource? For example lets says I have a listbox and I populate it''s datasource which happens to be a DataView with 100 rows when the form loads. I would like the autocomplete to filter that DataView when the users types in the text control. What would I need to do to have that happen using your example as a starting point? Thank you for your help. >Hi Morgan, > > I apologize for any confusion my sample might have caused. Please allow me to clarify the situation. > > AutoComplete does not work correctly with a simple style ComboBox. This is because AutoComplete overrides the ComboBox''s dropdown. A simple style ComboBox has no dropdown to override. Additionally, the DataSource of the ComboBox cannot be bound to the AutoComplete the way I bound the ListBox to AutoComplete in my sample, because every time the DataSource of the ComboBox is changed, the Text property changes, causing an infinite loop of TextChanged events. > > Fortunately, a ComboBox in simple style is little more than a TextBox and ListBox wired together. My sample takes advantage of this by wiring a TextBox and ListBox together in almost the same way. While different internally (i.e. you''ll have to code differently) from a ComboBox, the interface it presents to your users should be almost exactly the same. > > The sample I provided still requires a little work to be converted into a UserControl, and I''d be glad to answer any questions regarding that process. > >Regards, >Gregory Austin >Syncfusion Inc.

Administrator [Syncfusion]
Replied On April 21, 2005 12:08 PM

Hi Morgan, I''ve entered the addition of a simple style ComboBoxAutoComplete as Feature Request #165. Unfortunately, I can''t guarantee a timeframe for this feature being implemented. Regarding with your data binding question, I don''t think binding the data to the ListBox is possible in this situation. Instead, you should bind it to the AutoComplete. That way the ListBox will still display your data source and the AutoComplete will be populated with your list of choices. If you need to save additions to your data source, you can pull the entire list of valid entries out of AutoComplete.TableData. Regards, Gregory Austin Syncfusion Inc.

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.

;