Exemplo n.º 1
0
        private Telerik.Windows.Controls.GridViewColumnCollection CreateColumns()
        {
            int columnCount = 1000;
            int rowCount    = 1000000;

            Items = new ObservableCollection <MyObject>(from i in Enumerable.Range(0, rowCount) select new MyObject(i));
            MyConverter converter = new MyConverter();

            Telerik.Windows.Controls.GridViewColumnCollection columns = new Telerik.Windows.Controls.GridViewColumnCollection();


            for (int i = 0; i < columnCount; i++)
            {
                GridViewDataColumn column = new GridViewDataColumn();
                column.Header           = string.Format("Column {0}", i);
                column.IsReadOnly       = true;
                column.ShowFieldFilters = false;
                column.Width            = 150;

                Binding binding = new Binding("ID");
                binding.Converter          = converter;
                binding.ConverterParameter = i;
                column.DataMemberBinding   = binding;

                columns.Add(column);
            }

            return(columns);
        }
        private Telerik.Windows.Controls.GridViewColumnCollection CreateColumns()
        {
            int columnCount = 1000;
            int rowCount = 1000000;

            Items = new ObservableCollection<MyObject>(from i in Enumerable.Range(0, rowCount) select new MyObject(i));
            MyConverter converter = new MyConverter();
            Telerik.Windows.Controls.GridViewColumnCollection columns = new Telerik.Windows.Controls.GridViewColumnCollection();


            for (int i = 0; i < columnCount; i++)
            {
                GridViewDataColumn column = new GridViewDataColumn();
                column.Header = string.Format("Column {0}", i);
                column.IsReadOnly = true;
                column.ShowFieldFilters = false;
                column.Width = 150;

                Binding binding = new Binding("ID");
                binding.Converter = converter;
                binding.ConverterParameter = i;
                column.DataMemberBinding = binding;

                columns.Add(column);
            }

            return columns;
        }