tags:

views:

22

answers:

1

I have a ListView control with grouped items in it. My goal is to enable multiple selection only inside one group - the user should not be able to select any items except from those from the current group.
My first thought is on canceling some event (something that happens before the item is selected), but I can't find the right one.
Thanks in advance.

+1  A: 

Cancelling an event probably isn't the best idea; if a user tries to select something in a different group to the current selection, you really want the new item to be selected, and the selected items in the other group to be deselected.

I'd suggest responding to the ItemSelectionChanged event, and if the .IsSelected property of the event args is true, iterate through the list of items and deselect any that do not share a group with the newly selected item.

Flynn1179
Thanks, will it do this way.
rinat