Solved

Override textchanged on dropdownlist to not fire on databinding

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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