<Window x:Class="DatabaseFirstNorthwind.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:DatabaseFirstNorthwind"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
          xmlns:sys="clr-namespace:System;assembly=mscorlib">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <!--<telerik:RadEntityFrameworkCoreDataSource x:Name="coreDataSource" QueryName="Customers">
            <telerik:RadEntityFrameworkCoreDataSource.RelatedObjects>
                <sys:String>Orders</sys:String>
            </telerik:RadEntityFrameworkCoreDataSource.RelatedObjects>
            <telerik:RadEntityFrameworkCoreDataSource.DbContext>
                <local:NorthwindContext />
            </telerik:RadEntityFrameworkCoreDataSource.DbContext>
        </telerik:RadEntityFrameworkCoreDataSource>-->
        <telerik:RadGridView GroupRenderMode="Flat" 
                             ItemsSource="{Binding PagedSource, ElementName=pager}" 
                             RowIndicatorVisibility="Collapsed"
                             AutoGenerateColumns="False"
							 CanUserFreezeColumns="False"
							 CanUserResizeColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn />
                <telerik:GridViewDataColumn Header="CustomerID"
											DataMemberBinding="{Binding CustomerId}" />
                <telerik:GridViewDataColumn Header="Company Name"
											DataMemberBinding="{Binding CompanyName}" />
                <telerik:GridViewDataColumn Header="Contact Name"
											DataMemberBinding="{Binding ContactName}" />
                <telerik:GridViewDataColumn Header="Contact Title"
											DataMemberBinding="{Binding ContactTitle}" />
                <telerik:GridViewDataColumn Header="Address"
											DataMemberBinding="{Binding Address}" />
                <telerik:GridViewDataColumn Header="City"
											DataMemberBinding="{Binding City}" />
                <telerik:GridViewDataColumn Header="Region"
											DataMemberBinding="{Binding Region}" />
                <telerik:GridViewDataColumn Header="PostalCode"
											DataMemberBinding="{Binding PostalCode}" />
                <telerik:GridViewDataColumn Header="Country"
											DataMemberBinding="{Binding Country}" />
                <telerik:GridViewDataColumn Header="Phone"
											DataMemberBinding="{Binding Phone}" />
                <telerik:GridViewDataColumn Header="Fax"
											DataMemberBinding="{Binding Fax}" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                    <telerik:RadGridView GroupRenderMode="Flat"  ItemsSource="{Binding Orders}" RowIndicatorVisibility="Collapsed"
										 AutoGenerateColumns="False"
										 CanUserFreezeColumns="False"
										 CanUserResizeColumns="False"
										 ShowGroupPanel="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Header="Order ID"
														DataMemberBinding="{Binding OrderId}" />
                            <telerik:GridViewDataColumn Header="Order Date"
														DataMemberBinding="{Binding OrderDate}" />
                            <telerik:GridViewDataColumn Header="Customer"
														DataMemberBinding="{Binding ShipName}" />
                            <telerik:GridViewDataColumn Header="City"
														DataMemberBinding="{Binding ShipCity}" />
                            <telerik:GridViewDataColumn Header="Country"
														DataMemberBinding="{Binding ShipCountry}" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>
        </telerik:RadGridView>
        <telerik:RadDataPager x:Name="pager" Source="{Binding DataView}" PageSize="5"  Grid.Row="1" />
    </Grid>
</Window>
