<controls:ChildWindow x:Class="Hierarchy_RIA.ChildWindow1"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"                      
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:riaWeb="clr-namespace:Hierarchy_RIA.Web"                      
           Width="800" Height="800"
           Title="ChildWindow1" mc:Ignorable="d" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <controls:ChildWindow.Resources>
        <riaWeb:MyDataContext x:Key="myDataContext" />
    </controls:ChildWindow.Resources>
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance riaWeb:Order, CreateList=true}" Height="0" 
                                      LoadedData="orderDomainDataSource_LoadedData" Name="orderDomainDataSource" 
                                      QueryName="GetOrdersQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <riaWeb:NWDomainContext />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        
        <telerik:RadGridView Name="ordersGrid" ItemsSource="{Binding Data, ElementName=orderDomainDataSource}" >
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView ItemsSource="{Binding Order_Details}" />
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
        
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>