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 System.ComponentModel;
using System.ComponentModel.DataAnnotations;

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

            List<Test> testList = new List<Test>();

            Test test = null;
            for (int i = 0; i < 10; i++)
            {
                test = new Test();
                test.Id = i;
                test.Name = "Name" + i.ToString();
                test.Number = i.ToString();
                testList.Add(test);
            }

            radGridView.ItemsSource = testList;
        }
    }

    public class Test
    {
        [Display(AutoGenerateField = false)]
        [RangeAttribute(1, 10)]
        public int Id { get; set; }

        [Display(Order = 1, Name = "TestNumber")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "Exception")]
        public string Number { get; set; }

        [Display(Order = 0)]
        [Required(AllowEmptyStrings = false, ErrorMessage = "Exception")]
        public string Name { get; set; }
    }
}
