using System.Windows.Controls;
using Telerik.Windows.Controls;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace ColumnChoosed_WPF
{
	/// <summary>
	/// Interaction logic for ColumnChooser.xaml
	/// </summary>
	public partial class ColumnChooser : UserControl
	{
		public ColumnChooser(RadGridView grid)
		{
			InitializeComponent();

			this.DataContext = grid;
			var columns = new ObservableCollection<Telerik.Windows.Controls.GridViewColumn>();
			foreach(Telerik.Windows.Controls.GridViewColumn column in grid.Columns)
			{
				if(column.GetType() != typeof(GridViewSelectColumn))
				{
					columns.Add(column);
				}
			}
			this.listBox.ItemsSource = columns;
		}
	}
}
