Open lxman opened 3 years ago
I was having a similar problem with both CheckComboBox and CheckListBox.
I have a list of sets of data which includes a list of strings (or technically a ruby array of IDs, that I then get the strings), which I then pre-fill a form to indicate the elements of that list selected. I was using SelectedItemsOverride
to do this.
With ItemSelectionChanged
, when switching data sets, the selection change event seems to fire off twice, but not when changing the tickboxes themselves. With ItemSelectionChanging
, while the event seemed to fire when ticking the boxes, the indication of what was selected wouldn't change until I switched back and forth between data sets.
It's possible the real culprit was SelectedItemsOverride
. I created a string version of the current selection and used SelectedValue
instead, and the form now appears to function as expected. You appear to be using SelectedMemberPath
, but I wonder if the problem is related.
I found this issue too #1350, when searching for a solution to my problem, which appeared to describe the behaviour I was having.
EDIT: Gotta make sure the delimiter matches in the string representation for the combo box too, it seems it.
Hi lxman,
If I run your sample with the latest v4.1 version of the Toolkit, available on NuGet, it works : the ItemSelectionChanged event is fired on every click/unclick of the CheckComboBox items.
<Grid> <xctk:CheckComboBox x:Name="ViewSelect" HorizontalAlignment="Left" VerticalAlignment="Center" ItemsSource="{Binding ViewList}" VerticalContentAlignment="Center" SelectedMemberPath="IsSelected" ItemSelectionChanged="ViewSelect_ItemSelectionChanged" Padding="0,5,0,5" Margin="0,0,0,0" /> </Grid>
` public MainWindow()
{
InitializeComponent();
this.DataContext = this;
this.ViewList = new ObservableCollection
public ObservableCollection<string> ViewList
{
get;
set;
}
private void ViewSelect_ItemSelectionChanged( object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e )
{
System.Diagnostics.Debug.WriteLine("Changed");
}`
ViewList
is anObservableCollection<string>
The
ItemSelectionChanging
event is firing but the ```ItemSelectionChanged''' does not.