Lookup list in a custom control bound to screen property RRS feed

  • Question

  • I have a screen with an entity property MyEntity1, which has a nav property of type MyEntity2.

    I bind a custom control to MyEntity1 and need to display a lookup comboxbox for listing MyEntity2 values from the data source:

    <ComboBox SelectedItem="{Binding MyEntity2, Mode=TwoWay}"
                          DisplayMemberPath="DisplayName" />

    The custom control directly accesses the MyEntity2 entityset via OData to retrieve the lookup values  :

    myEntity2List.LoadCompleted += (s,e) =>
    {cbMyEntity2.ItemsSource = myEntity2List;}

    The comboxbox gets populated fine with MyEntity2 values, but when I select an item the MyEntity2 nav property of the MyEntity1 screen property does not get updated.

    I thought this may be due to the fact that the type of the items fetched by the control (defined in the service reference class) is not the same as the actual MyEntity2 LS type.

    But then I tried binding the list to MyEntity1.SomeIntegerField for testing purposes, same result : no binding update on selection changed.

    Can we bind a LS nav property to a lookup list in a custom control ? Is it a threading issue ?

    • Edited by ykhammal Thursday, September 4, 2014 2:45 PM
    Thursday, September 4, 2014 2:43 PM