Solved

Override textchanged on dropdownlist to not fire on databinding

Posted on 2011-03-02
3
698 Views
Last Modified: 2012-05-11
Hello

In a winform app I want to override when textchanged is fired on a dropdownlist.

I need to check that the text change actually came from user input (from the keyboard) opposed to the text changing from databinding.

Could anyone supply me with a code sample in c# or vb?

Thanks!
0
Comment
Question by:badpilot
[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
  • 2
3 Comments
 
LVL 17

Expert Comment

by:nepaluz
ID: 35020066
why are you using a textchanged handler?
Use the selectedindexchanged or selectedvaluechanged events instead.
0
 

Author Comment

by:badpilot
ID: 35036854
Sorry I maybe should have explained it better.

I'm using teleriks radmulticombobox and I want the user to be able to type in the box to search. When they reach a certain number of chars the textchanged fires and calls the method to get the data from the db and then binds the combobox.

The problem is that when the box binds the text value is changed to displaymember which fires the bind process again, which changes the text which fires the db call again and so on.

So I want to stop the textchanged from firing when the reason the text has changed is because of it binding.

Phew, I hope that makes sense!
0
 
LVL 17

Accepted Solution

by:
nepaluz earned 500 total points
ID: 35036969
a very mechanical way to handle thiswould be to declare a global boolean and only fire off the db routine when it is set, in your case, only when there has been a value typed into the combobox, and NOT when it is selected.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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