0

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?

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
Fabio
  • 1,037
  • 1
  • 10
  • 22
  • Please avoid adding "thank you notes" and signature to your post. See [meta](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts) before adding them back. – Alexei Levenkov Sep 22 '13 at 23:01
  • do you anywhere in property C to alter the lookUp edit ? – Turbot Sep 23 '13 at 01:26
  • looks like you have `ValueMember` of your `lookUpEdit` as `"B"`, of course its `DataSource` is `BS`? – King King Sep 23 '13 at 01:56

0 Answers0