using System;
using Telerik.WinControls;
using Telerik.WinControls.UI;
//using Telerik.OpenAccess;

namespace _5B_WCFUseService
{
  public partial class Form1 : RadForm
  {
    public Form1()
    {
      InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
      ServiceReference1.Service1Client client =
            new _5B_WCFUseService.ServiceReference1.Service1Client();
      cbCategories.DataSource = client.GetCategories();
      cbCategories.DisplayMember = "CategoryName";
      cbCategories.ValueMember = "CategoryID";

    }

    private void cbCategories_SelectedIndexChanged(object sender, EventArgs e)
    {
      //if ((sender as RadComboBox).SelectedValue != null)
      //{
      //  int categoryID = (int)(sender as RadComboBox).SelectedValue; 
      //  this.Text = (sender as RadComboBox).SelectedValue.ToString();
        //ObjectContainer.ChangeSet cs = 
        //  new ObjectContainer.ChangeSet(client.GetProducts(categoryID));
      //}
    }
  }
}
