Guillermo E. Grillo
Guillermo E. Grillo

Reputation: 1

in Silverlight, filling a combobox with data from another source than the dataform?

Using Silverlight I have a dataform bound to table A and I need to fill a combobox of this dataform with data from table B. How can I declare this in the XAML code?

Upvotes: 0

Views: 119

Answers (1)

Boluc Papuccuoglu
Boluc Papuccuoglu

Reputation: 2346

If your dataform is inside a UserControl which has a property called "TableBItems" for example, you could write:

<ComboBox SelectedItem={Binding FieldInTableA,Mode=TwoWay} 
  ItemsSource={Binding TableBItems, RelativeSource={RelativeSource AncestorType='UserControl'}} 
  DisplayMemberPath="FieldInTableBYouWantToShow"/>

Upvotes: 1

Related Questions