Question

I have a combo box and a label that are linked together with data binding.

enter image description here

When I change the selection in the combo box, the label doesn't show any change until I focus away from the combo box.

I would like to instead have the label show the change as soon as the user clicks on a different selection in the combo box.

Is there a solution without having to manually write a callback to the combobox SelectedValueChanged event?

I am trying to see what I can do with data binding in .NET 3.5 land.

Was it helpful?

Solution

Try updating the binding value on the SelectedIndexChanged event:

comboBox1.SelectedIndexChanged += (cb, cbArgs) => {
                                    comboBox1.DataBindings[0].WriteValue();
                                  };
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top