Solved

Combobox Match Behaviour when DropDownStyle = DropDownList

Posted on 2016-08-23
6
19 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
  • 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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now