This project has moved. For the latest updates, please go here.

CheckComboBox selectedItems

Developer
Apr 6 at 2:43 PM
A user wrote :
I'm getting a "The property "SelectedItems" does not have an accessible setter." error from the following XAML:

"
<xctk:CheckComboBox x:Name="UserGroupsCheckedComboBox" Grid.Row="1" Grid.Column="0"
ItemsSource="{Binding UserGroups}"
SelectedItems="{Binding SelectedUserGroups, Mode=OneWayToSource}"
SelectedItemsOverride="{Binding SelectedUserGroupsOverride}"
DisplayMemberPath="Name"
ValueMemberPath="ID"
Command="{Binding OnUserGroupsChangedCommand}"
Width="200"
HorizontalAlignment="Left"
VerticalAlignment="Center"
</xctk:CheckComboBox>
"
Developer
Apr 6 at 2:43 PM
Then the user wrote :
Also, "SelectedItemsOverride" Property (the actual "CheckComboBox"'s Property not the View Model's Binding Property) seems to always be "null" even though there are items selected (as reflected in the "SelectedItems" Property). I need to be able to write to and read from the whatever Property(ies) necessary to initially set / update / read the selected items in "CheckComboBox" via MVVM.
Developer
Apr 6 at 3:11 PM
Hi,

As stated in the documentation, "CheckComboBox.SelectedItems : Gets the collection of checked items."
This cannot be set.

As stated in the documentation, "CheckComboBox.SelectedItemsOverride : Gets or sets a custom IList of selected items."
This is a get/set property.
It lets you set the list of selectedItems, but will always be null if you don't set it.
What you want is to work the this property :
  <StackPanel>
    <xctk:CheckComboBox x:Name="UserGroupsCheckedComboBox"
                        ItemsSource="{Binding UserGroups}"
                        SelectedItemsOverride="{Binding SelectedUserGroups}"
                        DisplayMemberPath="Name"
                        ValueMemberPath="ID" />

    <StackPanel Margin="0,200,0,0"
                Orientation="Horizontal">
      <TextBlock Text="SelectedItems : " />
      <TextBlock Text="{Binding SelectedItemsOverride.Count, ElementName=UserGroupsCheckedComboBox}" />
    </StackPanel>
   
  </StackPanel>
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();
      this.UserGroups = new ObservableCollection<MyData>()
      {
        new MyData() { ID = 1, Name = "First" },
        new MyData() { ID = 2, Name = "Second" },
        new MyData() { ID = 3, Name = "Third" },
        new MyData() { ID = 4, Name = "Fourth" },
        new MyData() { ID = 5, Name = "Fifth" },
      };
      this.SelectedUserGroups = new ObservableCollection<MyData>() { this.UserGroups[ 2 ] };
      this.DataContext = this;
    }

    public ObservableCollection<MyData> UserGroups
    {
      get;
      set;
    }

    public ObservableCollection<MyData> SelectedUserGroups
    {
      get;
      set;
    }
  }

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

    public int ID
    {
      get;
      set;
    }
  }
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Apr 26 at 6:41 AM
Thanks, BoucherS! I just noticed this Discussion (20 days later)! CodePlex really should have a way of notifying commenters when people reply. Oh well, it's a moot point, since they're shuttering. So, are you an employee of Xceed?
  1. Re. "SelectedItems": Thx, I should've read the docs. The combo of this and the "SelectedItemsOverride" Properties is unusual way of implementing a multi-item Control. Any idea why?
  2. Re. "SelectedItemsOverride": Ok. It's working.
  3. "SelectedItemsOverride"'s Bound Property's is being updated by the View, but its Setter is never called. Do I have to Handle the Backing Variable's "CollectionChanged" Event or Bind to the "Command" Property to be notified when a selected items have changed?
  4. I just noticed that the "Command" that's usually executed whenever an item is toggled doesn't get called the first time I assign "SelectedItemsOverride" to a new "ObservableCollection" I've built.
Let me know if any of this shold be a new Discussion(s).
Apr 26 at 11:59 AM
Woah, wait a minute. Re. #1 ("Re. "SelectedItems"): You said "As stated in the documentation, "CheckComboBox.SelectedItems : Gets the collection of checked items."
This cannot be set.". Actually, I did read the docs and did know it was a read-only Property! That's why I made set the Binding "Mode=OneWayToSource" which, according to MSDN, "Updates the source property when the target property changes.". I read that to mean it should work even when the "target property" is "read-only"!
Developer
Apr 27 at 3:19 PM
Hi tchien69,
  1. The SelectedItemsOverride property was added something like 3 years ago to prevent a CheckListBox/CheckCombobox binding problem when used in a DataTemplate, could be related to issue https://wpftoolkit.codeplex.com/workitem/18431.
As for the OneWayToSource binding on a readOnly property, you could have a look at this page : https://meleak.wordpress.com/2011/08/28/onewaytosource-binding-for-readonly-dependency-property/.
  1. If you want to know when an item selection has changed, you can use the event CheckComboBox.ItemSelectionChanged. It will be called every time an item is selected or un-selected.
  2. What do you mean by "the "Command" that's usually executed whenever an item is toggled" ?
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Apr 27 at 7:00 PM
Edited Apr 27 at 7:01 PM
  1. Re. need for "SelectedItemsOverride" Property separate from "SelectedItems": Ok. Understood. Thx!
  2. Re. "OneWayToSource" Binding not supported by .NET on Read-Only Dependency Properties: Sigh. Ok. Understood. Thx!
  3. Re. "Command": I'm referring to the "Command" Property that listed in the docs (here: "https://wpftoolkit.codeplex.com/wikipage?title=CheckComboBox&referringTitle=Home") as "Gets or sets the command to execute when an item is checked/unchecked. (Inherited from Selector)". In my code sample above, I've Bound it to an ICommand via the XAML Attribute setting "Command="{Binding OnUserGroupsChangedCommand}"" the ICommand I've since renamed to a more appropriate "OnUserGroupTypeToggledCommand".
Developer
Apr 28 at 3:03 PM
Hi,

For the command property not being called the first time when "SelectedItemsOverride" is assigned to a new "ObservableCollection", how exactly do you reproduce this ? Here's my sample that looks good :
 <StackPanel>
      <xctk:CheckComboBox x:Name="UserGroupsCheckedComboBox"
                          ItemsSource="{Binding UserGroups}"
                          SelectedItemsOverride="{Binding SelectedUserGroups}"
                          DisplayMemberPath="Name"
                          Command="{Binding OnUserGroupTypeToggledCommand}"
                          ValueMemberPath="ID" />

      <StackPanel Margin="0,200,0,0"
                  Orientation="Horizontal">
        <TextBlock Text="SelectedItems : " />
        <TextBlock Text="{Binding SelectedItemsOverride.Count, ElementName=UserGroupsCheckedComboBox}" />
      </StackPanel>
</StackPanel>
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();

      this.UserGroups = new ObservableCollection<MyData>()
      {
        new MyData() { ID = 1, Name = "First" },
        new MyData() { ID = 2, Name = "Second" },
        new MyData() { ID = 3, Name = "Third" },
        new MyData() { ID = 4, Name = "Fourth" },
        new MyData() { ID = 5, Name = "Fifth" },
      };
      this.SelectedUserGroups = new ObservableCollection<MyData>() { this.UserGroups[ 2 ] };
      this.DataContext = this;

      this.OnUserGroupTypeToggledCommand = new RelayCommand( param => SaveExecute(), param => CanExecuteMyCommand() );
    }

    public ICommand OnUserGroupTypeToggledCommand
    {
      get;
      set;
    }

    public ObservableCollection<MyData> UserGroups
    {
      get;
      set;
    }

    public ObservableCollection<MyData> SelectedUserGroups
    {
      get;
      set;
    }

    private bool CanExecuteMyCommand()
    {
      return true;
    }

    public void SaveExecute()
    {
      System.Diagnostics.Debug.WriteLine("Saving !!");
    }
  }

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

    public int ID
    {
      get;
      set;
    }
  }


  public class RelayCommand : ICommand
  {
    #region Fields 
    readonly Action<object> _execute;
    readonly Predicate<object> _canExecute;
    #endregion // Fields 
    #region Constructors 
    public RelayCommand( Action<object> execute ) : this( execute, null ) { }
    public RelayCommand( Action<object> execute, Predicate<object> canExecute )
    {
      if( execute == null )
        throw new ArgumentNullException( "execute" );
      _execute = execute;
      _canExecute = canExecute;
    }
    #endregion // Constructors 
    #region ICommand Members 
    [DebuggerStepThrough]
    public bool CanExecute( object parameter )
    {
      return _canExecute == null ? true : _canExecute( parameter );
    }
    public event EventHandler CanExecuteChanged
    {
      add
      {
        CommandManager.RequerySuggested += value;
      }
      remove
      {
        CommandManager.RequerySuggested -= value;
      }
    }
    public void Execute( object parameter )
    {
      _execute( parameter );
    }
    #endregion // ICommand Members 
  }
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Apr 29 at 12:56 AM
Actually, it's not just the 1st time. It keeps not calling CheckComboBox's Command Property's Bound ICommand (OnUserGroupTypeToggledCommand) until I actually toggle an item in the CheckComboBox via the UI. I don't know if this makes a difference but here are a few differences between yours and my code:
  1. My SelectedItemsOverride's Bound Property's Backing Variable (selectedUserGroupTypesOverride) is initialized to an empty ObservableCollection<UserGroupType> at the View Model's Class level first.
  2. I have an "All" Checkbox whose IsChecked Property I set to true in the Window's Loaded Event Handler which results in calling the Setter of its Bound Property (UserGroupTypesAllChecked). That Setter first calls SelectedItemsOverride's Bound Property (SelectedUserGroupTypesOverride)'s Clear Method (which, btw, does Raise the Backing Variable (selectedUserGroupTypesOverride)'s CollectionChanged Event with an NotifyCollectionChangedEventArgs.Action of Reset). That Clear Method, as expected, doesn't result in a call to OnUserGroupTypeToggledCommand, because prior to the Clear Method call (after the first time I set the "All" Checkbox's IsChecked to true), no items were selected.
  3. However, when I subsequently call SelectedItemsOverride's Bound Property (SelectedUserGroupTypesOverride)'s Add Method to add each of all possible items each call to which I would've expected to result in a call to OnUserGroupTypeToggledCommand, it doesn't (even after repeated toggling of "All" Checkbox via the U.I.) - UNTIL I actually toggle an item off / on in the CheckComboBox via the UI!?! Afterwards, the OnUserGroupTypeToggledCommand gets called as expected for every single item whenever I toggle the "All" Checkbox on/off in the U.I..
Developer
May 1 at 2:18 PM
Hi,

Can you attach a sample (or modify the one I've copied in this post) so I could reproduce it the same way as you ? Maybe it's just an initialization problem or the way you are updating the SelectedItemsOverride's Bound Property.

Thanks.
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
May 1 at 8:19 PM
Edited May 2 at 5:25 PM
BoucherS: Please see my ".Xaml" and ".Xaml.Cs" code samples below and note the 3 occurrences of Comments that start with "!!!WARNING!!!".

UPDATE 3:15 pm: Btw, I don't actually use the Window's Code Behind as the View Model (nor am I trying to encourage it). I'm just doing so in this example to use the simplest code that will reproduce the problem as I suspect was the reason you did so also.

UPDATE 4:38 pm: Also, I just noticed that I said it's not calling Command Property's Bound ICommand. Actually, it is calling the ICommand, it's just not calling the ICommand's Execute Method. And that can be reproduced even in your above code sample (even after I fixed the location of the SelectedUserGroups Assignment Statement to after the initial Assignment Statement for the OnUserGroupTypeToggledCommand (such that an Execute Method for the ICommand will actually exist)).

UPDATE 5:08 pm: Fixed run-time error due to "canExecute == null" due untested last minute change.

UPDATE 5:30 pm: Clarified Comment on "UserGroupTypesAllCheckBox.IsChecked" Assignment Statement.

UPDATE 5/2/17 11:25 am: Fixed some Comments and other insignificant OCD refactoring. ;)
<Window x:Class="TestXceedCheckedComboBoxWpfApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:TestXceedCheckedComboBoxWpfApp"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"      
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525"
    >
    <StackPanel>
        <xctk:CheckComboBox x:Name="UserGroupsTypesCheckComboBox"
            ItemsSource="{Binding UserGroupTypes}"
            SelectedItemsOverride="{Binding SelectedUserGroupTypesOverride}"
            DisplayMemberPath="Name"
            Command="{Binding OnUserGroupTypeToggledCommand}"
            ValueMemberPath="ID" 
        />

        <StackPanel Margin="0,200,0,0"
            Orientation="Horizontal">
            <TextBlock Text="SelectedItems: " />
            <TextBlock Text="{Binding SelectedItemsOverride.Count, ElementName=UserGroupsCheckedComboBox}" />
        
        </StackPanel>

        <CheckBox Name="UserGroupTypesAllCheckBox"
            IsChecked="{Binding UserGroupTypesAllChecked}"
            VerticalAlignment="Center"
            >
            All
        </CheckBox>

    </StackPanel>
</Window>
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Input;

namespace TestXceedCheckedComboBoxWpfApp
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window, INotifyPropertyChanged
    {

        private List<UserGroupType> userGroupTypes;
        private ObservableCollection<UserGroupType> selectedUserGroupTypesOverride = new ObservableCollection<UserGroupType>();
        private bool userGroupTypesAllChecked;

        public event PropertyChangedEventHandler PropertyChanged;

        public MainWindow()
        {
            InitializeComponent();

            this.Loaded += MainWindow_Loaded;
            this.UserGroupTypes = new List<UserGroupType>()
              {
                new UserGroupType() { ID = 1, Name = "First" },
                new UserGroupType() { ID = 2, Name = "Second" },
                new UserGroupType() { ID = 3, Name = "Third" },
                new UserGroupType() { ID = 4, Name = "Fourth" },
                new UserGroupType() { ID = 5, Name = "Fifth" },
              };
            this.DataContext = this;

            //!!!WARNING!!!: The following Statement does NOT result in "OnUserGroupTypeToggled" being called!?!
            this.SelectedUserGroupTypesOverride = new ObservableCollection<UserGroupType>() { this.UserGroupTypes[0] };
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //!!!WARNING!!!: The following Statement does NOT result in "OnUserGroupTypeToggled" being called!?!
            this.SelectedUserGroupTypesOverride = new ObservableCollection<UserGroupType>() { this.UserGroupTypes[1] };

            //!!!WARNING!!!: The following assignment of the "IsChecked" Property does NOT and subsequent changes to the same 
            //  Property via the its Bound aka Source Property (in this case "UserGroupTypesAllChecked") via the U.I. do NOT result 
            //  in "OnUserGroupTypeToggled" being called UNTIL an "UserGroupsTypesCheckedComboBox" item is toggled on or off via 
            //  the U.I.!?!
            this.UserGroupTypesAllCheckBox.IsChecked = true;
        }

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        public ICommand _OnUserGroupTypeToggled { get; private set; }
        public ICommand OnUserGroupTypeToggledCommand
        {
            get
            {
                return _OnUserGroupTypeToggled
                ??
                (
                    _OnUserGroupTypeToggled =
                    (
                        new RelayCommand(execute: OnUserGroupTypeToggled)
                    )
                );
            }
        }

        public List<UserGroupType> UserGroupTypes
        {
            get
            {
                return userGroupTypes;
            }
            set
            {
                if (userGroupTypes != value)
                {
                    userGroupTypes = value;
                    OnPropertyChanged();
                }
            }
        }

        public bool UserGroupTypesAllChecked
        {
            get
            {
                return userGroupTypesAllChecked;
            }
            set
            {

                if (userGroupTypesAllChecked != value)
                {

                    userGroupTypesAllChecked = value;

                    // BEGIN Force select / clear all UserGroupTypes depending on whether userGroupTypesAllChecked is true.

                    // Build new empty (AllChecked = false) / full (AllChecked = true) selected items list in a temporary Collection
                    //  to avoid the normal ObservableCollection notifying the View until all changes are made.
                    var tempSelectedUserGroupTypes = new ObservableCollection<UserGroupType>();
                    if (userGroupTypesAllChecked == true)
                    {
                        UserGroupTypes.ForEach(ug => tempSelectedUserGroupTypes.Add(ug));
                    }
                    SelectedUserGroupTypesOverride = tempSelectedUserGroupTypes;

                    // END Force select / clear all UserGroupTypes depending on whether userGroupTypesAllChecked is true.

                    OnPropertyChanged();

                    //ReapplyFilters();

                } // if (userGroupTypesAllChecked != value)

            } // set
        }

        public ObservableCollection<UserGroupType> SelectedUserGroupTypesOverride
        {
            get
            {
                return selectedUserGroupTypesOverride;
            }
            set
            {
                if (selectedUserGroupTypesOverride != value)
                {
                    selectedUserGroupTypesOverride = value;
                    OnPropertyChanged();
                }
            }
        }

        public void OnUserGroupTypeToggled(object parameter)
        {
            System.Diagnostics.Debug.WriteLine("OnUserGroupTypeToggled.");

            var selectedUserGroupType = (UserGroupType)parameter;

            if (selectedUserGroupTypesOverride.Count < userGroupTypes.Count)
            {
                // Change the Backing Variable vs. the Bound Property, so its Setter won't un-check all items.  
                userGroupTypesAllChecked = false;
                // Notify View so it'll uncheck the checkbox.
                OnPropertyChanged(propertyName: nameof(UserGroupTypesAllChecked));
            }
            else if (selectedUserGroupTypesOverride.Count == userGroupTypes.Count)
            {
                // Change the Backing Variable vs. the Bound Property, so its Setter won't re-check all items.
                userGroupTypesAllChecked = true;
                // Notify View so it'll check the checkbox.
                OnPropertyChanged(propertyName: nameof(UserGroupTypesAllChecked));
            }

            //ReapplyFilters();
        }
    }

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

        public int ID
        {
            get;
            set;
        }
    }


    public class RelayCommand : ICommand
    {
        #region Fields 
        readonly Action<object> _execute;
        readonly Predicate<object> _canExecute;
        #endregion // Fields 
        #region Constructors 

        public RelayCommand(Action<object> execute) : this(execute, x => true) { }
        public RelayCommand(Action<object> execute, Predicate<object> canExecute)
        {
            if (execute == null)
                throw new ArgumentNullException(nameof(execute));
            if (canExecute == null)
                throw new ArgumentNullException(nameof(canExecute));
            _execute = execute;
            _canExecute = canExecute;
        }
        #endregion // Constructors 
        #region ICommand Members 
        [DebuggerStepThrough]
        public bool CanExecute(object parameter)
        {
            return _canExecute == null ? true : _canExecute(parameter);
        }
        public event EventHandler CanExecuteChanged
        {
            add
            {
                CommandManager.RequerySuggested += value;
            }
            remove
            {
                CommandManager.RequerySuggested -= value;
            }
        }
        public void Execute(object parameter)
        {
            _execute(parameter);
        }
        #endregion // ICommand Members 
    }
}
May 1 at 8:22 PM
Edited May 1 at 9:23 PM
Also, CheckComboBox.ItemSelectionChanged Event is not being Raised if the items are being toggled via CheckComboBox.SelectedUserGroupTypesOverride vs. the U.I.
Developer
May 2 at 4:53 PM
Hi,

You are right, the OnUserGroupTypeToggled() Command won't be executed at the 3 lines where your comment says "//!!!WARNING!!!".
This is because you are modifying the the SelectedUserGroupTypesOverride property, on which the CheckComboBox.SelectedItemsOverride is bound.
When modifying the CheckComboBox.SelectedItemsOverride property, a new collection of selectedItems is set.

Currently, the only times the CheckComboBox.Command will be executed, is when an item selection is changed. This means when the CheckComboBox popup has been opened (its item containers were created) and a checkBox from the CheckComboBox raises its "Selected" or "UnSelected" event.

If modifying CheckComboBox.SelectedItemsOverride while the CheckComboBox was never opened, you won't have the Command executed.

This will all be fixed in v3.4.
In this version, modifying the SelectedItemsOverride property will raise the Command for every affect item, as well as selecting/unselecting items.


――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Developer
May 2 at 4:56 PM
Issue https://wpftoolkit.codeplex.com/workitem/22527 has been created related to the command problem.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
May 2 at 5:36 PM
Ah-HA! GOT one! ;) Seriously, thank you and your company for confirming the issue and agreeing to fix it.
  1. So, I presume this is also what's causing "CheckComboBox.ItemSelectionChanged Event is not being Raised if (SelectedItemsOverride modified before drop-down has been opened)" (see my 5/1/17 2:22 pm comment)?
  2. So, I presume the workaround is to "Handle the (SelectedItemsOverride's Bound aka Source ObservableCollection Property's) Backing Variable's "CollectionChanged" Event"?
Developer
May 2 at 8:48 PM
Hi,
  1. Yes, the CheckComboBox.ItemSelectionChanged event is currently only raised when the drop-down has been opened. It will be fixed in v3.4 along with the Command property raising.
  2. Yes a workaround can be
    a) add a handler for CheckComboBox.SelectedItems.CollectionChanged (if the CheckComboBox.SelectedItemsOverride will no longer be modified) :
( ( ObservableCollection<UserGroupType> )UserGroupsTypesCheckedComboBox.SelectedItems ).CollectionChanged += MainWindow_CollectionChanged
b) add a handler of CollectionChanged for your bound variable to CheckComboBox.SelectedItemsOverride (if you are modifying the CheckComboBox.SelectedItems via your bound variable to CheckComboBox.SelectedItemsOverride ) :
tempSelectedUserGroupTypes.CollectionChanged += TempSelectedUserGroupTypes_CollectionChanged;
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
May 2 at 10:48 PM
  1. Re. ItemSelectionChanged: Ok, thx!
  2. Re. workaround: Ok, thx!
May 25 at 2:26 PM
I just want one, simple thing: Get list of items, that are checked. This component is designed so crappy, that it is impossible! I tried everything, but when I bind SelectedItemsOverride to ObservableCollection in ViewModel, NULL value is always present in property's setter no matter if something is checked or not.
Developer
Jun 6 at 9:29 PM
Hi,

Maybe you are just not using the control the right way. Have you tried the sample posted on Apr 6 at 10:11 AM ? In this sample, an ObservableCollection is bound to the CheckComBox.SelectedItemsOverride property. When selecting/un-selecting items from the CheckComboBox, the SelectedItemsOverride.Count is correctly updated.
You can also add a button to this sample and observe the content of the CheckComboBox's SelectedItemsOverride and SelectedItems properties :
 <Button Content="TEST"
              Click="Button_Click" />
private void Button_Click( object sender, RoutedEventArgs e )
    {
      var aa = UserGroupsCheckedComboBox.SelectedItemsOverride;
      var bb = UserGroupsCheckedComboBox.SelectedItems;
    }
it matches the selected/un-selected items that can be viewed in the CheckComboBox.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF