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;

namespace FilteringComboColumnExample_WPF
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
            this.RadGridView1.ItemsSource = GetListOfLocations();
            ((GridViewComboBoxColumn)this.RadGridView1.Columns[0]).ItemsSource = GetCountries();
        }

        private List<Location> GetListOfLocations()
        {
            List<Location> locations = new List<Location>();

            locations.Add(new Location() { CountryID = 1, CityName = "Paris" });
            locations.Add(new Location() { CountryID = 2, CityName = "Rome" });
            locations.Add(new Location() { CountryID = 3, CityName = "Berlin" });

            return locations;
        }

        private List<Country> GetCountries()
        {
            List<Country> countries = new List<Country>();

            countries.Add(new Country() { ID = 1, Name = "France" });
            countries.Add(new Country() { ID = 2, Name = "Italy" });
            countries.Add(new Country() { ID = 3, Name = "Germany" });

            return countries;
        }
    }

    public class Location
    {
        public int CountryID { get; set; }
        public string CityName { get; set; }
    }

    public class Country
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }

}
