using System.Windows;
using System.Windows.Input;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Controls;

namespace FocusOnTabToTextBox
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();
			this.clubsGrid.KeyboardCommandProvider = new CustomKeyboardCommandProvider(this.clubsGrid);
		
			this.clubsGrid.KeyDown += this.OnKeyDown;
		}

		private void OnKeyDown(object sender, KeyEventArgs e)
		{
			if (e.Key == Key.Tab)
			{
				if (this.clubsGrid.CurrentCell.Column.UniqueName == this.clubsGrid.Columns[2].UniqueName)
				{					
					this.myTextBox.Focus();
				}			
			}
		}

		private void Button1_Click(object sender, RoutedEventArgs e)
		{

		}

		private void Button2_Click(object sender, RoutedEventArgs e)
		{

		}

	
	}
}
