<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="CustomColumns.MainPage" FontFamily="Segoe UI" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="600" 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:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <TextBlock Text="C1FlexGrid: Custom columns" FontSize="14" FontWeight="Bold" />
        
        <c1:C1FlexGrid Name="_flex" Grid.Row="1" AutoGenerateColumns="False">
            <c1:C1FlexGrid.Columns>

                <!-- add some bound columns as usual -->
                <c1:Column Header="Line" Binding="{Binding Line}" />
                <c1:Column Header="Name" Binding="{Binding Name}" />
                <c1:Column Header="Color" Binding="{Binding Color}" />
                <c1:Column Header="Price" Binding="{Binding Price, StringFormat=c}" HorizontalAlignment="Right" />
                <c1:Column Header="Rating" Binding="{Binding Rating}" HorizontalAlignment="Right" />

                <!-- add some unbound columns -->
                <c1:Column ColumnName="ShowDetail">
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <HyperlinkButton Content="Detail..." Click="ShowDetail_Click" />
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>

                <c1:Column ColumnName="MoveUpDown">
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <Button Content="^" Click="MoveUp_Click" />
                                <Button Content="v" Click="MoveDown_Click" />
                            </StackPanel>
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>

                <c1:Column ColumnName="DeleteRecord">
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <Button Content="Delete..." Click="DeleteButton_Click" />
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>

            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</UserControl>