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

namespace WpfApp8
{
    public partial class MainWindow : Window
    {
        private ObservableCollection<ComboItem> source;

        public MainWindow()
        {
            InitializeComponent();
            source = new ObservableCollection<ComboItem>();
            for (int i = 0; i < 1000; i++)
            {
                source.Add(new ComboItem() { Code = i.ToString(), Label = "Item " + i });
            }
            comboBox.ItemsSource = source;
        }

        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < 400; i++)
            {
                ComboItem item = source.FirstOrDefault(s => s.Code == i.ToString());
                comboBox.SelectedItems.Add(item);
            }
        }
    }


    public class ComboItem
    {
        public string Code { get; set; }

        public int CodeInt
        {
            get
            {
                if (int.TryParse(Code, out int result))
                {
                    return result;
                }
                return -1;
            }
        }

        public string Label { get; set; }

        public int Order { get; set; }

        public int Tag { get; set; }

        public object TagObject { get; set; }

        public int ParentId { get; set; }

        public override string ToString()
        {
            return $"{Code}: {Label}";
        }
    }

}