Solved

Override textchanged on dropdownlist to not fire on databinding

Posted on 2011-03-02
3
686 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
  • 2
3 Comments
 
LVL 17

Expert Comment

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

Author Comment

by:badpilot
Comment Utility
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
Comment Utility
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

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

Join & Write a Comment

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

10 Experts available now in Live!

Get 1:1 Help Now