using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Controls;
using System.Linq;
using System.Collections.Generic;
using Telerik.Windows.Data;

namespace CustomizedFilteringControl
{
	public class CustomizedFilteringControl : FilteringControl
	{
		public override void Prepare(GridViewBoundColumnBase column)
		{
			base.Prepare(column);

			// Add the filter operators that the use will see here.
			var availableOperators = new List<FilterOperator>()
            {
                FilterOperator.Contains,
				FilterOperator.DoesNotContain
            };

			var cbo1 = this.ChildrenOfType<RadComboBox>()
			.Where(b => b.Name == "PART_Filter1ComboBox")
			.FirstOrDefault();
			cbo1.ItemsSource = availableOperators;
			if (cbo1.SelectedIndex == -1)
			{
				cbo1.SelectedIndex = 0;
			}

			var cbo2 = this.ChildrenOfType<RadComboBox>()
			.Where(b => b.Name == "PART_Filter2ComboBox")
			.FirstOrDefault();
			cbo2.ItemsSource = availableOperators;
			if (cbo2.SelectedIndex == -1)
			{
				cbo2.SelectedIndex = 0;
			}
		}
	}
}
