Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section

Remarks

UXMultipleSelectionComboBox is a queryable combo box control derived from the UXDataComboBox which is specially designed to support multiple selection. All features in UXPageableComboBox, such as multiple column, sorting, and paging feature, are also supported in this control. To learn more about these features, see UXDataComboBox Overview and UXPageableComboBox Overview.

Example

The following code shows how to use UXMultipleSelectionComboBox control in single column.

Code Block
titleXAML
languagexml
<Intersoft:UXMultipleSelectionComboBox SearchResult="{Binding Customers}"
        FilterDescriptors="{Binding LookUpDescriptor.FilterDescriptors, Mode=TwoWay}" 
        SortDescriptors="{Binding LookUpDescriptor.SortDescriptors, Mode=TwoWay}" 
        PageDescriptor="{Binding LookUpDescriptor.PageDescriptor}" 
        DisplayMemberPath="ContactName"> 
        <Intersoft:UXMultipleSelectionComboBox.DataContext> 
                <ViewModels:CustomerViewModel/> 
        </Intersoft:UXMultipleSelectionComboBox.DataContext> 
</Intersoft:UXMultipleSelectionComboBox>

Modern note

Notice that if you use the paging feature, you need to do special handling in your ViewModel. See UXPageableComboBox to learn how to handle this behavior.

To enable multiple columns feature, simply add the following code to your UXMultipleSelectionComboBox control markup.

Code Block
titleXAML
languagexml
<Intersoft:UXMultipleSelectionComboBox.Columns> 
        <Intersoft:UXDataComboBoxTextColumn Header="Customer ID"
				Binding="{Binding CustomerID}"
                DisplayMode="Image" ImageHeight="64" ImageWidth="64"
				ImageStretch="Fill" ImageBinding="{Binding PhotoPath}"/> 
        <Intersoft:UXDataComboBoxTextColumn Header="Contact Name"
				Binding="{Binding ContactName}"/>
        <Intersoft:UXDataComboBoxTextColumn Header="Company Name"
				Binding="{Binding CompanyName}"/>
        <Intersoft:UXDataComboBoxTextColumn Header="Country"
				Binding="{Binding Country}"/> 
</Intersoft:UXMultipleSelectionComboBox.Columns>

To learn more about Columns in UXMultipleSelectionComboBox, see UXPageableComboBox Columns Overview.

Working with CheckBoxHeaderVisibility Property

Often times, users need to check-all or uncheck-all the records. Of course, it will be a waste of time if users have to check or uncheck each record in the list. To address this scenario, UXMultipleSelectionComboBox already includes a built-in check-all or uncheck-all feature. To enable this feature, simply set the CheckBoxHeaderVisibility property to true. The control will automatically generate a checkbox in the column header area. Note that this time-saving feature can only be used in non-editable mode with multiple columns enabled.

Image Added

Working with InputSeparator Property

By default, selected items displayed on the non-editable combo box control is splitted with a comma character. If you want to change this behavior, you must set the InputSeparator property with a string or the character you desired.

Image Added

The following code change the separator value into a semicolon character which followed by a space character. It will produce results like the following image:

Code Block
titleXAML
languagexml
<Intersoft:UXMultipleSelectionComboBox SearchResult="{Binding Customers}"
        FilterDescriptors="{Binding LookUpDescriptor.FilterDescriptors, Mode=TwoWay}" 
        SortDescriptors="{Binding LookUpDescriptor.SortDescriptors, Mode=TwoWay}" 
        PageDescriptor="{Binding LookUpDescriptor.PageDescriptor}" 
        DisplayMemberPath="ContactName" InputSeparator="; "> 
        <Intersoft:UXMultipleSelectionComboBox.DataContext> 
                <ViewModels:CustomerViewModel/> 
        </Intersoft:UXMultipleSelectionComboBox.DataContext> 
</Intersoft:UXMultipleSelectionComboBox>

Definition

public class UXMultipleSelectionComboBox : UXDataComboBox, IMultipleSelection

...

The following table summarizes the members exposed in this class.

Public Constructors

UXMultipleSelectionComboBox Constructor()Initializes a new instance of the UXMultipleSelectionComboBox class.

Public Properties

AutoFilterSelectedItemsGets or sets a value indicating whether the selected items will be filtered automatically.
CheckBoxHeaderVisibilityGets or sets the checkbox header visibility.
CheckBoxStyleGets or sets the style applied to the checkbox element.
InputSeparatorGets or sets the input separator.
IsTextSearchEnabledNot applicable.
KeyMemberPathGets or sets a value that represents the properties path used to filter the selected items when the UXMultipleSelectionComboBox is enabled.
RemoveItemCommandGets or sets command that will be invoked when removing an item.
SelectedItemConverter 
SelectedItemsGets or sets the selected items
SelectedItemsCollectionGets selected items collection.
SelectionInputControlStyleGets or sets the selection input control style.

Protected Properties

ChangeSelectionInternal usage.
ProductProduct Info.
SuspendCollectionChangedInternal usage.

Fields

AutoFilterSelectedItemsPropertyIdentifies the AutoFilterSelectedItems dependency property.
CheckBoxHeaderVisibilityPropertyIdentifies the CheckBoxHeaderVisibility dependency property.
CheckBoxStylePropertyIdentifies the CheckBoxHeaderVisibility dependency property.
InputSeparatorPropertyIdentifies the InputSeparator dependency property.
KeyMemberPathPropertyIdentifies the KeyMemberPath dependency property.
RemoveItemCommandPropertyIdentifies the RemoveItemCommand dependency property.
SelectedItemsPropertyIdentifies the SelectedItems dependency property.
SelectionInputControlStylePropertyIdentifies the SelectionInputControlStyle dependency property.

Public Methods

AttachEventHandlers()Attach built-in event handlers to control templates. Call this method if necessary.
DetachedEventHandlers()Detach built-in event handlers from control templates. Call this method if necessary.
InitializeTemplates()Initializes control templates.
IsMultipleSelection()Gets a value that indicates whether the current action is multiple selection.
OnApplyTemplate()Builds the visual tree for the UXMultipleSelectionComboBox when a new template is applied.
Select(int, bool)Select the item on specified index.
Select(int)Select the item on specified index.
Select(object, bool)Select the specified item.
Select(object)Select the specified item.
SelectAll()Select all items.
Unselect(int, bool)Unselects item at specified index.
Unselect(int)Unselect the item at specified index.
Unselect(object, bool)Unselect the specified item.
Unselect(object)Unselect the specified item.
UnselectAll()Unselect all items.

Protected Methods

ChangeVisualState(bool)Change visual state.
ClearSelection()Clear current selection.
ClearSelection(object)Clear current selection.
GetContainerForItemOverride()Creates or identifies the element that is used to display the given item.
InitializeSelectedItems()Initialize selected items collection.
InitializeSelection()Initialize selection.
InitializeSelection(DependencyObject, object)Initialize selection.
IsItemItsOwnContainerOverride(object)Determines if the specified item is (or is eligible to be) its own container.
Menu_Opened(object, ISRoutedEventArgs)Called when the drop down menu is opened.
Menu_Repositioned(object, UXPopUpEventArgs)Called when the drop down menu is repositioned.
OnGotFocus(RoutedEventArgs)Called before element GotFocus event occurs.
OnItemsChanged(NotifyCollectionChangedEventArgs)Called when the value of the ItemsControl.Items property changes.
OnItemsSourceChanged(IEnumerable, IEnumerable)Called when the ItemsSource changes.
OnLostFocus(RoutedEventArgs)Called before element LostFocus event occurs.
OnMouseLeftButtonDown(MouseButtonEventArgs)Called when MouseLeftButtonDown event occurs.
OnSelectedIndexChanged(int, int)Called when the value of the SelectedIndex property changes.
OnSelectedItemChanged(object, object)Called when the value of the SelectedItem property changes.
OnSelectedValueChanged(object, object)Called when the value of the SelectedValue property changes.

...

public string KeyMemberPath { get; set; }

Gets or sets a value that represents the properties path used to filter the selected items when the UXMultipleSelectionComboBox is enabled.

Anchor
P:Intersoft.Client.UI.Data.UXMultipleSelectionComboBox.RemoveItemCommand
P:Intersoft.Client.UI.Data.UXMultipleSelectionComboBox.RemoveItemCommand

...