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.Data;
using Telerik.WinControls.UI;

namespace _1486771MCCBselectedValue
{
    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);

            DataView dv = new DataView(nwindDataSet.Tables["Products"]);

            radMultiColumnComboBox1.DisplayMember = "ProductName";
            radMultiColumnComboBox1.ValueMember = "ProductID";
            radMultiColumnComboBox1.DataSource = dv;

            this.radMultiColumnComboBox1.AutoFilter = true;
            CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor();
            FilterDescriptor prodName = new FilterDescriptor("ProductName", FilterOperator.Contains, "");
            FilterDescriptor prodQuantity = new FilterDescriptor("QuantityPerUnit", FilterOperator.Contains, "");
            compositeFilter.FilterDescriptors.Add(prodName);
            compositeFilter.FilterDescriptors.Add(prodQuantity);
            compositeFilter.LogicalOperator = FilterLogicalOperator.Or;
            this.radMultiColumnComboBox1.EditorControl.FilterDescriptors.Add(compositeFilter);

            this.radMultiColumnComboBox1.AutoSizeDropDownToBestFit = true;

            //this.radMultiColumnComboBox1.SelectedValue = 5;

            this.radMultiColumnComboBox1.SelectedIndex = 3;

        }
    }
}
