using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.UI;

namespace _1576263Grid
{
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
        }

        private void RadForm1_Load(object sender, EventArgs e)
        { 
            this.productsTableAdapter.Fill(this.nwindDataSet.Products); 
            this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories);

            this.radGridView1.DataSource = this.productsBindingSource;
            this.radGridView1.Columns.Remove("CategoryID");

            GridViewComboBoxColumn comboColumn = new GridViewComboBoxColumn("CategoryID"); 
            comboColumn.DataSource = this.categoriesBindingSource;
            comboColumn.ValueMember = "CategoryID";
            comboColumn.DisplayMember = "CategoryName";
            comboColumn.FieldName = "CategoryID"; 
            this.radGridView1.Columns.Insert(2, comboColumn);

            this.radGridView1.BestFitColumns();
        }
    }
}