Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Selector::SelectedItem Property

 

Gets or sets the first item in the current selection or returns null if the selection is empty

Namespace:   System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
[BindableAttribute(true)]
property Object^ SelectedItem {
	Object^ get();
	void set(Object^ value);
}

Property Value

Type: System::Object^

The first item in the current selection or null if the selection is empty.

If a Selector supports selecting a single item, the SelectedItem property returns the selected item. If a Selector supports multiple selections, SelectedItem returns the item that the user selected first.

Setting SelectedItem in a Selector that supports multiple selections clears existing selected items and sets the selection to the item specified.

Identifier field

SelectedItemProperty

Metadata properties set to true

BindsTwoWayByDefault, Journal

The following example gets the SelectedItem from a ListBox.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2017 Microsoft