views:

68

answers:

2

This is using winforms and the problem is that I have a listbox and a combo box, both tied to the same datasource, same display members, same value members. All is bound just fine and the items show up in both the controls. But when I change a selection in one control, it moves to the same index in the other control. I don't have any events tied to either control. It is just happening on its own. Has anyone ever run into this?

A: 

I think that might be intended to be a feature. For Master/Detail type forms.

Jay
If so, can I turn it off?
Josh
+2  A: 

The datasource is a separate object. When one of the controls changes the datasource active row it sends out an update notification to the other controls to move accordingly. This is normal and expected behavior.

The idea behind it is to simplify navigating record sets while keeping all the bound controls in sync.

If you don't want that, use two datasources tied to the same underlying data.

Chris Lively