using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Data;
using Telerik.Windows.Controls.GridView;

namespace TextBoxInGroupHeaderSample_WPF
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();
			List<Item> items = new List<Item>();
			items.Add(new Item() { Name = "item1" });
			items.Add(new Item() { Name = "item1" });
			items.Add(new Item() { Name = "item2" });
			items.Add(new Item() { Name = "item2" });
			items.Add(new Item() { Name = "item3" });

			var descriptor = new GroupDescriptor() { Member = "Name" };
			descriptor.AggregateFunctions.Add(new CountFunction() { Caption = "count: " });
			this.RadGridView1.GroupDescriptors.Add(descriptor);
			this.RadGridView1.ItemsSource = items;
		}

		private void TextBox_Loaded(object sender, RoutedEventArgs e)
		{
		}
	}

	public class Item
	{
		public string Name { get; set; }
	}
}
