tags:

views:

31

answers:

2

Hi Guys,

I have this combo box

    <ComboBox Height="23"
              SelectionChanged="comboBox1_SelectionChanged">
        <ComboBoxItem Content="Opt1"/>
        <ComboBoxItem Content="Opt2"/>
    </ComboBox>

Basically what I need is to run two methods, the one already bound (combobox1_SelectionChanged) and an additional one I created. Is this possible?

+5  A: 

I would probably just bind to 1 function and have that function call the common pieces of code.

Brian R. Bondy
+1, looks like a more elegant solution.
Adrian Faciu
+2  A: 

Yes, but you can't do this declaratively. Use the += operator in C#.

MyComboBox.SelectionChanged += new SelectionChangedEventHandler(method1);
MyComboBox.SelectionChanged += new SelectionChangedEventHandler(method2);
...
BlueCode