using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Data;
using Telerik.Windows.Controls;

namespace InsertWithTab
{
	/// <summary>
	/// Interaction logic for Window1.xaml
	/// </summary>
	public partial class Window1 : Window
	{
		public Window1()
		{
			InitializeComponent();
			this.playersGrid.KeyDown += new KeyEventHandler(playersGrid_KeyDown);
		}

		void playersGrid_KeyDown(object sender, KeyEventArgs e)
		{
			bool isInEditMode = this.playersGrid.CurrentCell != null ? this.playersGrid.CurrentCell.IsInEditMode : false;

			if (e.Key == Key.Tab && isInEditMode)
			{
				this.playersGrid.CurrentColumn = this.playersGrid.Columns[0];
				this.playersGrid.BeginInsert();
			}
		}

		private void Button1_Click(object sender, RoutedEventArgs e)
		{

		}

		private void Button2_Click(object sender, RoutedEventArgs e)
		{

		}
	}
}
