Xceed Toolkit Plus for WPF v5.0 Documentation
Xceed.Wpf.ListBox Assembly / Xceed.Wpf.ListBox Namespace / ListBox Class / SelectedItems Property


In This Topic
    SelectedItems Property (ListBox)
    In This Topic
    Gets the list of currently selected items for the ListBox control.
    Syntax
    'Declaration
     
    Public ReadOnly Property SelectedItems As IList
    'Usage
     
    Dim instance As ListBox
    Dim value As IList
     
    value = instance.SelectedItems
    public IList SelectedItems {get;}

    Property Value

    The list of currently selected items for the ListBox.
    Remarks

    When used with a data-virtualized (asynchronous) source, this property will throw an exception; BeginGetSelectedItems and EndGetSelectedItems should be used in this situation.

    For a listbox whose SelectionMode is set to Multiple or Extended, the SelectedItems property returns a list that contains the selected items.

    For a listbox whose SelectionMode is set to Single, the SelectedItems property returns a list that contains the selected item. For a single-selection listbox, the selected item can also be retrieved by using the SelectedItem property or the index of the selected item by using the SelectedIndex property.

    Example
    For more information and examples on selecting data, refer to the Selecting Data topic.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also