Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Selector -- How do I ensure that it's only going to allow a single selection and not multiple selections?

Basically, I have a control that I want to extend from the Selector Class. I know that Selector allows for multiple child items to be selected, but I don't want that. I only want a single child to be selected at a time.

Is there a setting that I'm not seeing in the Selector class that distinguishes between single/multi selections allowed, or is that something that is controlled by the class that I write that extends the Selector class?

like image 351
michael Avatar asked May 20 '11 14:05

michael


2 Answers

Have you tried the MultiSelector? It has a CanSelectMultipleItems property that might help.

like image 62
Botz3000 Avatar answered Nov 16 '22 14:11

Botz3000


Selector doesn't have support for multiple selections. ListBox, and therefore ListView, do support multiple selections.

In any event, you are responsible for the actual selection of items. Selector just exposes the properties and events that deal with selection.

like image 32
CodeNaked Avatar answered Nov 16 '22 13:11

CodeNaked