Hi,
Try this :
Try this :
<xctk:CheckComboBox x:Name="_checkComboBox"
ItemsSource="{Binding MyData}"
ItemSelectionChanged="_checkComboBox_ItemSelectionChanged_1"
Width="250"
Height="25"/>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
_checkComboBox.DataContext = this;
this.MyData = new ObservableCollection<string>()
{
"First", "Second", "Third", "Fourth", "Fifth", "SelectAll"
};
}
public ObservableCollection<string> MyData
{
get;
set;
}
private void _checkComboBox_ItemSelectionChanged_1( object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e )
{
var checkComboBox = sender as CheckComboBox;
if( checkComboBox != null )
{
if( e.IsSelected && object.Equals( e.Item, this.MyData.Last() ) )
{
checkComboBox.SelectedItemsOverride = new ObservableCollection<string>( this.MyData );
}
else if( !e.IsSelected )
{
if( checkComboBox.SelectedItems.Contains( this.MyData.Last() ) )
{
checkComboBox.SelectedItems.Remove( this.MyData.Last() );
}
}
}
}
}