<Page
    x:Class="FlexGridSamples.Printing"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexGridSamples"
    xmlns:c1="using:C1.Xaml.FlexGrid"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Button Content="Print" Margin="4" MinWidth="80" Click="_btnPrint_Click" />

        <c1:C1FlexGrid x:Name="_flex" 
                       Grid.Row="1" 
                       ShowMarquee="True" 
                       IsReadOnly="True"
                       AllowMerging="None"
                       MinColumnWidth="35"
                       MinRowHeight="35"
                       AutoGenerateColumns="False"
                       BorderThickness="1">
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding Name}" />
                <c1:Column Binding="{Binding Line}" />
                <c1:Column Binding="{Binding Color}" />
                <c1:Column Binding="{Binding Price}" GroupAggregate="Average" />
                <c1:Column Binding="{Binding Weight}" GroupAggregate="Average" />
                <c1:Column Binding="{Binding Cost}" GroupAggregate="Average" />
                <c1:Column Binding="{Binding Volume}" GroupAggregate="Average" />
                <c1:Column Header="Rating" Width="110" >
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <local:RatingControl Rating="{Binding Rating, Mode=OneWay}"/>
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>
                <c1:Column Binding="{Binding Discontinued}" />
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</Page>