Custom auto-complete logic

4 posts, 0 answers
  1. Ben
    Ben avatar
    28 posts
    Member since:
    Dec 2007

    Posted 10 Mar 2009 Link to this post

    Hi,

    I have a RadComboBox which contains a list of objects. These objects have both a *name* and a *code*. The text value for each combo item is *<name> (<code>)* and the object is stored in the item value.

    I have AutoCompleteMode = SuggestAppend and DropDownStyle = DropDown which gives me the necessary auto-complete logic for a user typing in something matching *<name> (<code>)*.

    However I want the user to be able to type in something and the combo attempt to match on either the name OR code. Is this possible by sub-classing the combo and overriding some event?

    For example, say we have an object with name = "Test Object" and code = "TST01". If the user types "T" we would get a match on this item, and if they typed "Test" or "TST" we would also get a match. 

    Is there anyway to override the auto-complete logic using custom code?

    Regards,
    Ben
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 12 Mar 2009 Link to this post

    Hello Ben,

    Thank you for writing.

    I am afraid that the combobox does not offer convenient means of overriding the autocomplete behavior - you will have to disable the autocomplete functionality of your combo, subscribe to the TextChanged event and implement your own custom logic for auto completion.
     
    Please write back if you have other questions.
     

    Sincerely yours,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ben
    Ben avatar
    28 posts
    Member since:
    Dec 2007

    Posted 29 Mar 2009 Link to this post

    Thanks Victor,

    You don't happen to have any examples of this sort of thing floating around? It would greatly aid me in my task if you did. 

    Thanks again.
    Ben
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 31 Mar 2009 Link to this post

    Hello Ben,

    Thank you for writing. I am afraid that we do not have a ready example. You could try googling for C# autocomplete logic or something similar. I found this, it is a rather long post but contains useful ideas. Feel free to write back if you want to ask something else.

    Greetings,
    Victor
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top