I can not figure this one out.
I have a windows form and a DevExpress LookupEdit on it.
The lookup edit has a databinding to property A of BindingSource BS on its editvalue. The databind BS is attached to object C. C is a EF dabatase first object. Like this.
BS.DataSource = C
In the EditValueChanged event of the LookupEdit I want to change the value of another property of object C, like this:
private void lookUp_EditValueChanged(object sender, EventArgs e)
{
if (lookUp.EditValue != null)
{
C.B = NewValue;
}
}
What happens is that when I get to "C.B = NewValue" EditValueChanged fires again and prevents the values from changing. It fires because the Property changed of C fires.
What I'm doing wrong? How do I solve this?