<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="C1DataGrid_Demo2010.CustomColumns" d:DataContext="{d:DesignData Source=/DesignData/SampleProducts.xaml}" mc:Ignorable="d" 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:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:C1DataGrid_Demo2010" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <c1:C1DataGrid x:Name="grid" ItemsSource="{Binding}" AutoGeneratingColumn="grid_AutoGeneratingColumn" LoadedRowPresenter="grid_LoadedRowPresenter" CanUserAddRows="False" CanUserResizeRows="True" RowHeight="Auto" KeyDown="grid_KeyDown" Grid.Row="1">
            <c1:C1DataGrid.Columns>
                <local:DataGridRichTextColumn Header="RichTextBox" Width="100" Binding="{Binding Description, Mode=TwoWay}" />
                <c1:DataGridTemplateColumn Header="Template Columns">
                    <c1:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Description}" TextAlignment="Left" />
                        </DataTemplate>
                    </c1:DataGridTemplateColumn.CellTemplate>
                    <c1:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Path=Description, Mode=TwoWay}" TextAlignment="Center" MaxLength="50" />
                        </DataTemplate>
                    </c1:DataGridTemplateColumn.CellEditingTemplate>
                </c1:DataGridTemplateColumn>
                <!-- 
				Custom Checkbox column 
				Adds a checkbox to the header and listen to its events
				-->
                <c1:DataGridCheckBoxColumn Binding="{Binding Available, Mode=TwoWay}" SortMemberPath="Available" FilterMemberPath="Available" MinWidth="108">
                    <c1:DataGridCheckBoxColumn.Header>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                            <TextBlock Margin="6,0,6,0" VerticalAlignment="Center" Text="Available" />
                            <CheckBox HorizontalAlignment="Left" IsHitTestVisible="True" VerticalAlignment="Center" Grid.Column="1" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked" Loaded="CheckBox_Loaded" />
                        </StackPanel>
                    </c1:DataGridCheckBoxColumn.Header>
                </c1:DataGridCheckBoxColumn>
            </c1:C1DataGrid.Columns>
            <!--<c1:C1DataGrid.TopRows>
				<local:DataGridTemplateRow IsScrollable="True">
					<DataTemplate>
						<TextBlock Text="This is a template row." HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" FontSize="18"  />
					</DataTemplate>
				</local:DataGridTemplateRow>
			</c1:C1DataGrid.TopRows>-->
        </c1:C1DataGrid>
    </Grid>
</UserControl>