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.
views:
22answers:
1
+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
2010-09-09 11:45:30
Thanks, will it do this way.
rinat
2010-09-10 08:46:13