<Window x:Class="_726143_RadGridView_WPF_AR_98.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:my="clr-namespace:_726143_RadGridView_WPF_AR_98"
        Title="MainWindow" Height="700" Width="700">
	<Window.Resources>
		<my:AgencyViewModel x:Key="MyViewModel"/>
        
    </Window.Resources>
	<Grid DataContext="{StaticResource MyViewModel}">
		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		
		<telerik:RadGridView Grid.Row="0" 
                             Name="clubsGrid" 
                             ItemsSource="{Binding Source={StaticResource MyViewModel}, Path=Agency}"
                             AutoGenerateColumns="False"
                             Margin="5">
			<telerik:RadGridView.Columns>
                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding Name}"
                                                ItemsSource="{Binding Source={StaticResource MyViewModel}, Path=Agency}"
                                                SelectedValueMemberPath="Name"
                                                DisplayMemberPath="Name">
                    <telerik:GridViewComboBoxColumn.EditorStyle>
                        <Style TargetType="telerik:RadComboBox">
                            <Setter Property="OpenDropDownOnFocus" Value="True"/>
                            <Setter Property="SelectionBoxTemplate">
                                <Setter.Value>
                                    <DataTemplate >
                                        <TextBlock Text="{Binding Name}"
                                                   Foreground="Green" 
                                                   FontWeight="Bold"/>
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="ItemTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <Grid Margin="5,5,5,5" Width="350">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <TextBlock FontWeight="Bold" 
                                                       Grid.ColumnSpan="2" 
                                                       Text="{Binding Name}" />
                                            <TextBlock Grid.Row="1" 
                                                       Text="Phone:" />
                                            <TextBlock Grid.Row="1" 
                                                       Foreground="Blue" 
                                                       Margin="40,0,0,0"
                                                       Text="{Binding Phone}" />
                                            <TextBlock Grid.Row="1" Grid.Column="1" Text="Zip:" />
                                            <TextBlock Grid.Row="1" 
                                                       Foreground="Blue"
                                                       Grid.Column="1" 
                                                       Margin="26,0,0,0"
                                                       Text="{Binding Zip}" />
                                        </Grid>
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </telerik:GridViewComboBoxColumn.EditorStyle>                  
                </telerik:GridViewComboBoxColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Phone}"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Zip}" />
			</telerik:RadGridView.Columns>
		</telerik:RadGridView>
		<StackPanel Grid.Row="1" Orientation="Horizontal">
			<Button Name="Button1"
                Content="Do Something 1" 
                Click="Button1_Click"
                Margin="5"
                HorizontalAlignment="Left"/>
			<Button Name="Button2"
                Content="Do Something 2" 
                Click="Button2_Click"
                Margin="5"
                HorizontalAlignment="Left"/>
		</StackPanel>
	</Grid>
</Window>
