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 Telerik.Windows.Controls;
using System.ComponentModel;

namespace DisabledItemsInCombo_WPF
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public static List<Seat> allSeats = new List<Seat>();

		public List<Seat> AvailableSeats
		{ 
			get
			{
				return allSeats.Take(2).ToList();
			}
		}

		public MainWindow()
		{
			InitializeComponent();
			
			for (int i = 0; i < 5; i++)
			{
				allSeats.Add(new Seat() { ID = i });
			}

			List<Person> persons = new List<Person>();
			for (int j = 0; j < 5; j++)
			{
				persons.Add(new Person() { ID = j });
			}

			this.RadGridView1.ItemsSource = persons;
			((GridViewComboBoxColumn)this.RadGridView1.Columns[1]).ItemsSource = allSeats;

			this.DataContext = this;
		}
	}

	public class Person
	{
		public int ID { get; set; }
		public int SeatID
		{
			get;
			set;
		}
	}

	public class Seat
	{
		public int ID { get; set; }
		public string Name 
		{ 
			get
			{
				if (this.ID != 0)
				{
					return string.Format("Seat {0}", this.ID);
				}
				else 
				{
					return "Please select...";
				}
			}
		}
	}
}
