
Visual Basic (Declaration) | |
---|---|
Public MustInherit Class ISMultipleSelectionControl Inherits ISSelectionControl Implements IControl, IFramework, IMultipleSelection, ISelection |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As ISMultipleSelectionControl |
C# | |
---|---|
public abstract class ISMultipleSelectionControl : ISSelectionControl, IControl, IFramework, IMultipleSelection, ISelection |
Delphi | |
---|---|
public class ISMultipleSelectionControl = class(ISSelectionControl, IControl, IFramework, IMultipleSelection, ISelection)abstract; |
JScript | |
---|---|
public abstract class ISMultipleSelectionControl extends ISSelectionControl implements IControl, IFramework, IMultipleSelection, ISelection |
Managed Extensions for C++ | |
---|---|
public __gc abstract class ISMultipleSelectionControl : public ISSelectionControl, IControl, IFramework, IMultipleSelection, ISelection |
C++/CLI | |
---|---|
public ref class ISMultipleSelectionControl abstract : public ISSelectionControl, IControl, IFramework, IMultipleSelection, ISelection |
The base class for multiple selection controls in ClientUI is ISMultipleSelectionControl. This class inherits ISSelectionControl and defines SelectedItems property which you can also bind using MVVM pattern. This property indicates the current selected items and also can be used to define the selected items.
When this property is changed, it means that the current selection has changed. Consequently, it will synchronize all selection related properties, including updating the IsSelected property for each item.
You can change the selection by replacing the SelectedItems property, or adding and removing the items from the current SelectedItems collection.
The following example shows how to work with SelectedItems property.
XAML | ![]() |
---|---|
<Intersoft:DockPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Intersoft:UXListBox x:Name="ListBox1" HorizontalAlignment="Center" VerticalAlignment="Center" SelectionMode="Extended"> <Intersoft:UXListBoxItem Content="Item #1" IsSelected="True"/> <Intersoft:UXListBoxItem Content="Item #2" IsSelected="True"/> <Intersoft:UXListBoxItem Content="Item #3"/> <Intersoft:UXListBoxItem Content="Item #4"/> </Intersoft:UXListBox> <Intersoft:FieldLabel Intersoft:DockPanel.Dock="Top" Header="SelectedIndex"> <TextBlock Text="{Binding SelectedIndex, ElementName=ListBox1}" Margin="4"/> </Intersoft:FieldLabel> <Intersoft:FieldLabel Intersoft:DockPanel.Dock="Top" Header="SelectedItem"> <TextBlock Text="{Binding SelectedItem.Content, ElementName=ListBox1}" Margin="4"/> </Intersoft:FieldLabel> <Button Intersoft:DockPanel.Dock="Top" Content="Change Selected Items" Margin="4" Click="Button_Click"/> </Intersoft:DockPanel> |
C# | ![]() |
---|---|
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { ObservableCollection<object> selectedItems = new ObservableCollection<object>(); selectedItems.Add(this.ListBox1.Items[0]); selectedItems.Add(this.ListBox1.Items[3]); this.ListBox1.SelectedItems = selectedItems; } |
This sample demonstrates that when you perform multiple selection, such as by holding Shift or Ctrl key, the SelectedItems property will be updated. You can also change the selected items by changing this SelectedItems property as demonstrated when you click the button.
Intersoft.Client.Framework.ISItemsControl
Intersoft.Client.Framework.ISSelectionControl
Intersoft.Client.Framework.ISMultipleSelectionControl
Intersoft.Client.UI.Controls.Interactivity.ISDragableMultipleSelectionControl
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family