This example demonstrates how to create a custom LookUpEdit class descendant that allows you to provide autocomplete items based on typed text. The items can be provided via the GetAutoCompleteList event.
Question Comments
Added By:
Brian Winkleman at:
1/21/2015 9:44:28 AM How would i then add this control as a xtraBar to a BarManager?
Added By:
Alexey Z (DevExpress Support) at:
1/21/2015 11:21:54 PM Hello,
In order not to mix several questions within one thread, I will extract your question to a new ticket. Let us continue our discussion there
How to add a LookUpEdit descendant to BarEditItem.Added By:
Onyx DevExpress at:
7/26/2016 5:45:21 PM Behavior is slightly different between 16.1 vs 15.s and prior ones in the examples.
In 16.1 a value type that's not in the list will be kept while in prior version it reverts to whatever it likes from the list.
Example: I type Support and it makes it Supportyahio
I remove the yahio
with 16.1 it leaves it Support but with 15.2 and prior it reverts to Supportyahio
I can't find anything in the release notes. Is this a new feature? I like the way it works in 16.1 but will it stay this way? Added By:
Stas (DevExpress Support) at:
7/27/2016 6:02:28 AM Hello,
I've created a separate ticket on your behalf (The behavior of the E3132 example in version 16.1 is slightly different than in version 15.x). It has been placed in our processing queue and will be answered shortly.
Added By:
SamDev at:
10/24/2016 7:31:25 PM This control with a bit of customization (painting capabilities to show more than what is being typed in the box in the dropdown) would be a hit control. I think everyone using Winforms feels left out. Problem is with custom development of this which is possible is the fact that it may not work in the future.
Example usage scenario that no other winforms control handles well:
1. Type a generic search (example in our application they want to search for anything in there application clients, appointment descriptions etc)
2. Dropdown will have an event handler of possible hits associated with a unique id that the event handler allows to pass in
Example dropdown
---------------------
John <------Typed text
---------------------
John (client) - id 0 <------ Results that are not sitting in a table in a database
We will meet with John (appointment)
---------------------
3. User selects the value and the key returned in the callback function is set as the value. Of course the developer utilizing control will have to know what keys are associated with search result and keep track of which ones they posted as a result in the call back that is provided with devexpress. So as the user types the call back is called. This control is actually very simple to implement but we don't want to do it as we are using straight devexpress controls so they can be upgrade proof.
example callback
searchresult_populate(string typedtextofuserintextbox)
{
// Allow user of control to populate with endless variation of data vs a concrete dataset (think no tables exist)
Dictionary<key,valuestoshow> valuestoshow = GenerateADictionaryFromSearchByWebAPI(typedtextofuserintextbox) or GetDataSearchedFromFile(typedtextofuserintextbox)
return valuestoshow;
}
I think this is going to be the best and most flexible editor and will reduce a lot of variations of dropdowns. Allowing painting of results (highlighting typed text).
A perfect example is from a great website called google. Simple and returns infinite array of information from potentially limitless data sources. Its up to the developer to choose. Tired of hacking this out and using gridlookupedit. I want to do a simple select and populate it whichever way and not have to be so tightly bound to a database. Jquery has this control and many other frameworks even your devexpreme autocomplete widget.
Added By:
SamDev at:
10/24/2016 7:34:58 PM Winforms needs this badly.
https://js.devexpress.com/Demos/WidgetsGallery/#demo/editors-autocomplete-overviewAdded By:
Stas (DevExpress Support) at:
10/25/2016 6:18:04 AM Hello,
To avoid any misunderstanding, let's continue discussion of this question in the An editor with a dynamic autocomplete list ticket.
Added By:
Vladimir Sorokin at:
12/29/2016 11:32:37 AM Great example, but in case I set SearchMode.OnlyInPopup it stop working!
Can you advise how it can be fixed?
And one more question - how is it possible to implement async loading of AutoCompleteListEventArgs?Added By:
Stas (DevExpress Support) at:
12/29/2016 1:40:37 PM Hello Vladimir,
To answer other questions, I've created separates tickets in order not to mix different issues in one thread and avoid possible misunderstanding. Please refer to them for further discussion.
If in the E3132 example, SearchMode is set to OnlyInPopup, the example doesn't work correctly
Is it possible to implement asynchronous loading of AutoCompleteListEventArgs in the E3132 example?
Added By:
Yuriy Kokin at:
1/12/2017 1:37:57 AM Great example, but in case I set SearchMode.OnlyInPopup it stop working!
Can you advise how it can be fixed?
And one more question - how is it possible to implement async loading of AutoCompleteListEventArgs?