<UserControl x:Class="TutorialsSilverlight.LargeDataset"
    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"
    mc:Ignorable="d"
    d:DesignHeight="400" d:DesignWidth="487" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <c1:C1DataSource Name="c1DataSource1" DomainContextTypeName="TutorialsSilverlight.Web.DomainService1">
            <!-- An RiaViewSource of Order Details in Virtual Mode. -->
            <c1:RiaViewSource PageSize="50" QueryName="GetOrder_Details" VirtualMode="Managed"/>
        </c1:C1DataSource>
      
        <!-- Display total order detail count. -->
        <StackPanel Orientation="Horizontal" Margin="4">
            <TextBlock Text="Row count: "/>
            <TextBlock Text="{Binding [GetOrder_Details].TotalItemCount, ElementName=c1DataSource1}"/>
        </StackPanel>

        <c1:C1DataGrid Grid.Row="1" AutoGenerateColumns="False" Name="dataGrid1" ItemsSource="{Binding [GetOrder_Details], ElementName=c1DataSource1}" >
            <c1:C1DataGrid.Columns>
                <c1:DataGridTextColumn Header="Order ID" Binding="{Binding OrderID}"/>
                <c1:DataGridTextColumn Header="Product ID" Binding="{Binding ProductID}" />
                <c1:DataGridTextColumn Header="Unit price" Binding="{Binding UnitPrice, StringFormat=c}"/>
                <c1:DataGridTextColumn Header="Quantity" Binding="{Binding Quantity}"/>
                <c1:DataGridTextColumn Header="Discount" Binding="{Binding Discount}"/>
            </c1:C1DataGrid.Columns>
            <!-- A control handler that manages virtual mode in this C1DataGrid. -->
            <c1:C1DataSource.ControlHandler>
                <c1:ControlHandler VirtualMode="True"/>
            </c1:C1DataSource.ControlHandler>
        </c1:C1DataGrid>
    </Grid>
</UserControl>
