using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using Telerik.Windows.Controls;
using System.Collections.ObjectModel;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            var columnCount = 1000;
            var rowCount = 1000000;
            var converter = new MyConverter();

            for (var i = 0; i < columnCount; i++)
            {
                RadGridView1.Columns.Add(new GridViewDataColumn()
                {
                    Header = string.Format("Column {0}", i),
                    DataMemberBinding = new Binding("ID")
                    {
                        Converter = converter,
                        ConverterParameter = i,
                    },
                });

                DataGrid1.Columns.Add(new DataGridTextColumn()
                {
                    Header = string.Format("Column {0}", i),
                    Binding = new Binding("ID")
                    {
                        Converter = converter,
                        ConverterParameter = i,
                    },
                });
            }

            DataContext = new ObservableCollection<MyObject>(from i in Enumerable.Range(0, rowCount) select new MyObject() { ID = i });
        }
    }
}
