using System.Windows;
using System.Linq;
using Telerik.Windows.Controls;

namespace AddingNewDataItem
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();
			
		}

		private void Button1_Click(object sender, RoutedEventArgs e)
		{
			this.playersGrid.CurrentColumn = this.playersGrid.Columns.OfType<GridViewColumn>().First();
			this.playersGrid.BeginInsert();
		}		


		private void playersGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
		{			
			e.NewObject = new Player();
		}

		private void playersGrid_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
		{
			MessageBox.Show("RowEditEnded is fired!");
		}

		private void playersGrid_BeginningEdit(object sender, Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e)
		{			
		}
	}
}
