Multiple collections

1 posts, 0 answers
  1. steve
    steve avatar
    9 posts
    Member since:
    Nov 2010

    Posted 20 Nov 2011 Link to this post

    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)

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