Wednesday, September 06, 2006

ComboBox DataSource And Refresh Issues

How many times have you been frustrated by the fact , that you set the DataSource on a
ComboBox and it does Not show up or it does not Refresh .

basically,
code like
myComboBox.DataSource = value

does not update the values on screen

the workaround to get this working though not elegant is :

BindingManagerBase manager = myComboBox.BindingContext(value);
manager.SuspendBinding();
myComboBox.DataSource = value;
manager.ResumeBinding();