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

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

		private void Button1_Click(object sender, RoutedEventArgs e)
		{
			var selectedCell = this.playersGrid.CurrentCell as GridViewCell;
			var propertyName = (selectedCell.Column as GridViewDataColumn).DataMemberBinding.Path.Path;
			var item = selectedCell.ParentRow.Item as Player;
			var index = this.playersGrid.Items.IndexOf(item);
			if(index+1 < this.playersGrid.Items.Count)
			{
				var nextItem = this.playersGrid.Items[index + 1];
				var objectType = typeof(Player);
				objectType.GetProperty(propertyName).SetValue(nextItem, "SDFSDFSDF", null);
			}
			

		}
	}
}
