views:

23

answers:

0

Hi.

I have scenerio like this:

I have a BindingSource, typed DataSet and a ComboBox which property SelectedValue is bound to the BindingSource. On my form a have various controls but I guess the rule working for ComboBox will be applicable to the rest controls so I am describing a simplified scenerio.

To insert a new empty row I run this code:

DataSetOperators.OperatorsRow OperatorsRow = (DataSetOperators.OperatorsRow)((DataRowView)operatorsBindingSource.AddNew()).Row;

Now I have an empty fresh row and a pointer to it, unfortunately it seams that my ComboBox is unaware of the data change when I perform such code:

OperatorzyRow.ID = 1;

ComboBox doesn't reflect this change - the value is not shown in the control.

However if I do it like this:

ComboBox.SelectedValue = 1;

The value is shown in the control and the value goes correctly to the underlying field in the row.

So, what should I do to make ComboBox to react on this operation: OperatorzyRow.ID = 1

Thanks in advance.