Solved

Combobox Match Behaviour when DropDownStyle = DropDownList

Posted on 2016-08-23
6
45 Views
Last Modified: 2016-09-03
I have an Combobox with DropDownStyle = DropDownList. This DropDownStyle should not be changed!
When the user types a Letter, the DropDownList moves to the first entry starting with this letter. Is it possible to overwrite this behaviour? For example the DropDownList should move to the first entry containing the letter, typed by the user?
0
Comment
Question by:jdkern
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 41766499
You can not achieve this without customization. You need to write custom code and extend the behaviour of the Combobox.
Please refer the following article:
http://www.codeproject.com/Tips/755707/ComboBox-with-Suggestions-Based-on-Loose-Character
0
 

Author Comment

by:jdkern
ID: 41766554
Sorry, the proposed example from codeproject does not work with DropDownStyle = DropDownList!
Clearly, I have to write custom code to change the behaviour. But which method should I best overwrite? KeyPress? Or is there a better way?
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 41766591
You can use the onSelectionChanged event
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 

Accepted Solution

by:
jdkern earned 0 total points
ID: 41775849
Thank you, Ramkisan Jagtap!

I solved my Problem.

Roughly speaking I catch the pressed Letters in KeyPress and store them in a string "userInput".
In OnSelectedIndexChanged I search the best match for "userInput" with the help of the FindString method and set SelectedIndex to the corresponding value.
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 41775892
Good to know that you found the solution.

 Cheers
0
 

Author Closing Comment

by:jdkern
ID: 41782781
?
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question