Solved

Override textchanged on dropdownlist to not fire on databinding

Posted on 2011-03-02
3
699 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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