This is a migrated thread and some comments may be shown as answers.

Master ComboBox with Detail Grid

1 Answer 84 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
underwater
Top achievements
Rank 1
underwater asked on 12 Apr 2011, 09:04 PM
I am just starting out, and trying to use data binding to display a parent child relationship.

I need to first have the user select in a ComboBox my List of "Currency" objects and display in a Grid the related "CurrencyRates" collection of the selected currency object

I can see the list of currencies in the combo when I bind the ItemsSource property to the DataContext
<telerik:RadComboBox ItemsSource="{Binding}" DisplayMemberPath="Name" x:Name="cboCurrencyList"  />


I am not sure how to get a Grid to show the child collection CurrencyRates.... I've tried the code below but didn't work
Source="{Binding ElementName=cboCurrencyList, Path=SelectedValue}"/>

I am using EF4

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 15 Apr 2011, 02:59 PM
Hello,

Assuming that the RadComboBox ItemsSource is a collection of Currency objects, then with your configuration the value of the SelectedValue property will be of type Currency. If the Currency type has a property CurrencyRates, the Grid Source should be something like:
Source="{Binding ElementName=cboCurrencyList, Path=SelectedValue.CurrencyRates}"

Instead of SelectedValue you could use SelectedItem with the same result.

Regards,
Valeri Hristov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
underwater
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or