I'm trying to add the OnChange or Changed or IndexChanged event to the "Drop-down list box" control in InfoPath using VS Tools for applications.
If found the following code how this is done with buttons:
((ButtonEvent)EventManager.ControlEvents["ButtonName"]).Clicked += new ClickedEventHandler(FormCode_Clicked);
I would think this is also possible with other controls, but I can't seem to find the cast object to be able to add the event to my drop-down list.
((?)EventManager.ControlEvents["Project_x0020_Number"]).SelectedIndexChanged += new EventHandler(FormCode_SelectedIndexChanged);
I tried the object ComboBox, but then their was an error that this object could not be casted to the type ComboBox.
I hope someone can give me some advice. All I want to do is basically run a Query that filters my data depending on the selected value in my "Project Number" box.
maybe also good to mention: I'm changing the form that will go in a word document (used as template in SharePoint). I don't really think this matters, but thought I mention it any way.
Thanks in advance
Oxillery