I have a container control with some elements and a text field. I want to bind a keydown event to the textfield and do a specific database search.
As I have multiple instances of the container control I can’t (and I shouldn’t I guess) place the event in the ‘original’ container control. So I want to add the keydown event to an instance but I noticed the keydown event doesn’t fire?
If you are speaking of the KeyDown of the CC itself, it’s likely that the KeyDown of the textfield(s) is stealing the keydown event. A CC with no textfields or other controls which contain their own keydown events will fire the CC keydown
Add event handlers to the CC that you can implement in the window. The textfield passes its events to the CC which passes them on to the window. In reverse, the window calls methods on the CC which in turn manipulates the textfield. The containercontrol adds an additional layer between the control and the window, so you define an API that allows the controls of the CC to interact with the outside world in a logical, consistent manner.