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

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

            ((GridViewComboBoxColumn)this.RadGridView1.Columns[0]).ItemsSource = GetActivityTypes(); 
            RadGridView1.ItemsSource = this.GetDataGrid();
        }

        private DataView GetDataGrid()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("ActivityType", typeof(int));

            dt.Rows.Add(1);
            dt.Rows.Add(2);
            dt.Rows.Add(3);
            dt.Rows.Add(4);
            return dt.DefaultView;
        } 

        private System.Collections.IEnumerable GetActivityTypes()
        {
            List<ActivityType> ActivityTypes = new List<ActivityType>();
            ActivityTypes.Add(new ActivityType() { ID = 0, Name = "" });
            ActivityTypes.Add(new ActivityType() { ID = 1, Name = "פיתוח תוכנה" });
            ActivityTypes.Add(new ActivityType() { ID = 2, Name = "ליווי או''ש" });
            ActivityTypes.Add(new ActivityType() { ID = 3, Name = "תכנון פונקציונאלי" });
            ActivityTypes.Add(new ActivityType() { ID = 4, Name = "פרויקטים גלובליים" });
            return ActivityTypes;
        } 
    }
}
