This project has moved and is read-only. For the latest updates, please go here.

CheckListBox : SelectedValue not updated on SelectedItems.Add/Remove

Mar 7, 2016 at 1:25 PM
A user wrote :
"If i add item to SelectedItems by use SelectedItems.Add(object) , the ItemSelectionChanged event raise , this is fine but when i check SelectedValue i do not find the value of this object.

This also apply when i remove an item SelectedItems.Remove(object)"
Mar 7, 2016 at 1:26 PM
I cannot reproduce the bug. Can you submit a sample ?
Here's one that works :
        <xctk:CheckListBox x:Name="_checkListBox"/>
       <TextBlock Text="{Binding SelectedValue, ElementName=_checkListBox}"/>
       <Button Content="ADD" Click="Button_Click"/>
 public MainWindow()

      _checkListBox.ItemsSource = new ObservableCollection<string>()

    private void Button_Click( object sender, RoutedEventArgs e )
      _checkListBox.SelectedItems.Add( "Subban" );