<Window x:Class="EditWithRowDetails_COmmitEdit.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:EditWithRowDetails_COmmitEdit"
        Title="MainWindow" Height="700" Width="700">
	<Window.Resources>
		<my:MyViewModel 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 Clubs}"
                             AutoGenerateColumns="False"                            
                             Margin="5">

			<telerik:RadGridView.RowDetailsTemplate >
				<DataTemplate >
					<StackPanel Orientation="Horizontal"  Margin="10,10,10,10" >
						<Grid >
							<Grid.ColumnDefinitions >
								<ColumnDefinition Width="120" />
								<ColumnDefinition Width="230"/>
								<ColumnDefinition Width="120"/>
								<ColumnDefinition Width="230"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition />
								<RowDefinition />
								<RowDefinition />
								<RowDefinition />
							</Grid.RowDefinitions>

							<TextBlock Grid.Row="0" Grid.Column="0" Margin="5,5,5,2" Text="Name:" VerticalAlignment="Center" Foreground="Black" />
							<TextBox  Grid.Row="0" Grid.Column="1" Margin="5,5,5,2" Height="24"  Text="{Binding Name,Mode=TwoWay, UpdateSourceTrigger=Default}" VerticalContentAlignment="Center" />
							<TextBlock Grid.Row="1" Grid.Column="0" Margin="5,2,5,2" Text="Established:" VerticalAlignment="Center" Foreground="Black" />
							<TextBox Grid.Row="1" Grid.Column="1" Margin="5,2,5,2" Height="24"  Text="{Binding Established,Mode=TwoWay, UpdateSourceTrigger=Default}" VerticalContentAlignment="Center" />
							<TextBlock Grid.Row="2" Grid.Column="0" Margin="5,2,5,2" Text="StadiumCapacity:" VerticalAlignment="Center" Foreground="Black" />
							<TextBox Grid.Row="2" Grid.Column="1" Margin="5,2,5,2" Height="24"  Text="{Binding StadiumCapacity,Mode=TwoWay, UpdateSourceTrigger=Default}" VerticalContentAlignment="Center" />

							<telerik:RadButton Content="CommitEdit" Click="RadButton_Click" Height="24" Grid.Column="2"/>
 						</Grid>
					</StackPanel>
				</DataTemplate>
			</telerik:RadGridView.RowDetailsTemplate>
			<telerik:RadGridView.Columns>
				<telerik:GridViewToggleRowDetailsColumn/>
				<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
				<telerik:GridViewDataColumn DataMemberBinding="{Binding Established}"
                                            Header="Est." 
                                            DataFormatString="{}{0:yyyy}"/>				
				<telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}" 
                                            Header="Stadium" 
                                            DataFormatString="{}{0:N0}"/>
			</telerik:RadGridView.Columns>
		</telerik:RadGridView>
	</Grid>
</Window>
