Re: AutoComplete ComboBox Search on Substring for KeyPress

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



memead wrote:
I have a combobox displaying the full name of a customer (e.g. John Smith) and would like to go to the LAST name whenever a user presses a key while on this combobox. I have looked at the AutoCompleteMode and AutoCompleteSource properties of the combobox, but they only key off of the FIRST name (e.g. pressing "B" will select "Bob Smith", not "Sam Barnes"). Even FindString and FindStringExact only appear to key off of the prefix. This combobox, cboCustomer, has a .DataSource set to a DataView (dv) which contains two fields, the customer's name (e.g. "John Smith") and their customer number (e.g. 12345). The .ValueMember of this combobox is dv.CustomerNumber and the .DisplayMember is set to dv.FullName. How can I set the AutoCompleteSource (?) to be a substring (Last Name) of the .DisplayMember (Full Name)? I looked at Ken Tucker's response in "Typing in a ComboBox" (04/12/2006) and it look interesting, but I do not know if this would help me. Any help is appreciated.

Thank you.


I have an implementation that uses a text box and a hidden (until typing) listbox. It will present names on a "contains" basis. I am not near the box the code is on but will post it tommorow.

LS
.



Relevant Pages

  • RE: AutoComplete ComboBox Search on Substring for KeyPress
    ... "Kerry Moorman" wrote: ... Wouldn't it make more sense to display the name in the combobox as Last, ... I have looked at the AutoCompleteMode and AutoCompleteSource ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Combobox AutoCompleteMOde
    ... ComboBox combo = sender as ComboBox; ... // und der AutoCompleteSource ist None. ... Dipl.Inf. Frank Dzaebel ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • RE: AutoComplete ComboBox Search on Substring for KeyPress
    ... Wouldn't it make more sense to display the name in the combobox as Last, ... "memead" wrote: ... I have looked at the AutoCompleteMode and AutoCompleteSource ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Combobox AutoCompleteMOde
    ... Die AutoCompleteSource steht auf ListItems. ... Und der AutoCompleteMode steht auf Suggest oder SuggestAppend ... Wenn ich im Textfeld der ComboBox jetzt etwas tippe, filtert mir das Autocomplete meine doppelten und dreifachen Werte heraus und das möchte ich nicht. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Disallow editting of certain words
    ... out and replaced the selected text (either typing or ComboBox) that ... the selected text was 1 character long no matter what I did. ...
    (microsoft.public.vb.general.discussion)