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

namespace AsyncValidationWPFExample
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();
			this.radGridView.ItemsSource = this.CreatePersonsDataSource(3);
		}

		private void radGridView_BeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs e)
		{

		}

		private void radGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
		{
			
		}

		private List<Person> CreatePersonsDataSource(int count)
		{
			List<Person> persons = new List<Person>();
			for (int i = 0; i < count; i++)
			{
				persons.Add(new Person
				{
					FirstName = "John " + i,
					LastName = "Doe " + i,
					Age = i,
					BirthDay = DateTime.Today
				});
			}

			persons.Add(new Person());

			return persons;
		}
	}
}
