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

Multiple collections

0 Answers 24 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
steve
Top achievements
Rank 1
steve asked on 20 Nov 2011, 06:00 PM
Hello all.

My current EF model looks like this:
Klanten 1----* KlantenOrders *----1 Orders

I have a datatemplate to show all the information on 1 template, looking like this:

<telerik:DataFormDataField Label="First Name" DataMemberBinding="{Binding KlantenSet.Naam, Mode=TwoWay}" />
                    <telerik:DataFormDataField Grid.Column="1" Label="Last Name" DataMemberBinding="{Binding KlantenSet.Voornaam, Mode=TwoWay}" />
                    <telerik:RadGridView Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" ItemsSource="{Binding Path=OrdersSet}"/>

I set the CurrentItem to the KlantOrders. Hower, the radgridview does not display the ordersset at all.
When i change the ItemsSource to, for example, the KlantenSet, it does display the tables.
If i set it to KlantenSet.OrdersSet, it also displays the data (but not the data that i need).

So how can i make my radgrid show all the Orders for the selected customer, straight from the Orders table, and not the data form the KlantenOrders table?

I use this code to retrieve the KlantenOrders:

Public Function GetKlantOrders(KlantID As Integer) As IEnumerable(Of KlantenOrders)
        Return DataContext.ST.KlantenOrdersSet.Where(Function(s) s.KlantID = KlantID)
End
Function

Many thanks, i'm stucked for a long time on this now...

No answers yet. Maybe you can help?

Tags
DataForm
Asked by
steve
Top achievements
Rank 1
Share this question
or