Hi
I'm trying to wire up a SelectionChanged handler for my ListBox. I'm using SelectionMode="Multiple" and when I select an item, sure enough the event handler gets called with the AddedItems collection containing the item I selected. However, when I click on that item again, which should deselect the item and remove it from the selection, it instead calls through to the event handler with the item still listed in the AddedItems collection and not in the RemovedItems collection.
<
telerik:RadListBox
x:Name
=
"ParentItemsList"
ItemsSource
=
"{Binding ParentItems}"
SelectionMode
=
"Multiple"
SelectionChanged="ParentItemsListSelectionChanged" >
<
telerik:RadListBox.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
...
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadListBox.ItemTemplate
>
</
telerik:RadListBox
>
private void ParentItemsListSelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
{
foreach (var item in e.AddedItems)
{
{
foreach (var item in e.AddedItems)
{
//multiple hits here, removed items are listed in the AddedItems collection
...
}
foreach (var item in e.RemovedItems)
{
...
}
foreach (var item in e.RemovedItems)
{
//never reaches here
...
}
}
...
}
}