<UserControl x:Class="HeaderText_628128.MainPage"
             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:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:my="clr-namespace:HeaderText_628128"
             mc:Ignorable="d" d:DesignHeight="700" d:DesignWidth="700">
    <UserControl.Resources>
        <my:MyViewModel x:Key="MyViewModel"/>
        <DataTemplate x:Key="HeaderTemplate">           
            <TextBlock Text="{Binding Text, ElementName=TextBox1}"/>         
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" 
          Background="White" 
          DataContext="{StaticResource MyViewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <TextBox x:Name="TextBox1" />
            <TextBlock Text="{Binding Path=Text, ElementName=TextBox1}" />
        </StackPanel>
        <telerik:RadGridView Grid.Row="1"
                             Name="clubsGrid" 
                             ItemsSource="{Binding Clubs}"
                             AutoGenerateColumns="False"
                             Margin="5">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" >                    
                    <telerik:GridViewDataColumn.HeaderCellStyle>
                        <Style TargetType="telerik:GridViewHeaderCell">
                            <Setter Property="ContentTemplate" Value="{StaticResource HeaderTemplate}"/>
                        </Style>
                    </telerik:GridViewDataColumn.HeaderCellStyle>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Established}"
                                     
                                            DataFormatString="{}{0:yyyy}"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}" 
                                            Header="Stadium" 
                                            DataFormatString="{}{0:N0}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

    </Grid>
</UserControl>
