using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel.DataAnnotations; 

namespace SL.OrderAttribute
{
	public partial class MainPage : UserControl
	{
		public MainPage()
		{
			InitializeComponent();

			List<Person> persons = new List<Person>();
			for (int i = 0; i < 100; i++)
			{
				persons.Add(new Person()
				{
					FirstName = "John",
					LastName = "Smith " + (i % 10),
					Age = i,
					DateOfBirth = new DateTime(2010, 5, (i % 10) + 1),
					Married = (i % 2 == 1)
				});
			}

			telerikGrid.ItemsSource = persons; 
		}
	}

	public class Person
	{
		[Display(Name = "FName", Order = 10, ShortName = "test name")]
		public string FirstName { get; set; }

		[Display(Name = "Last Name", Order = 1)]
		public string LastName { get; set; }

		[Display(Order = 11)]
		public int Age { get; set; }

		[Display(Order = 111)]
		public DateTime DateOfBirth { get; set; }

		[Display(Order = 2)]
		public bool Married { get; set; }
	} 
}
