Solved

Combobox Match Behaviour when DropDownStyle = DropDownList

Posted on 2016-08-23
6
40 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Easy filter aspnet 2 35
Code enhancement 4 33
custom authorization on controller action and HTML in asp.net mvc 1 45
VB.net/VSTO Excel Add-in 2 18
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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