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)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

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

/** @property */
public void set_SelectedItem (Object value)

public function get SelectedItem () : Object

public function set SelectedItem (value : Object)

<object>
  <object.SelectedItem>
    <Object .../>
  </object.SelectedItem>
</object>

Property Value

The first item in the current selection or a null reference (Nothing in Visual Basic) if the selection is empty.

Identifier Field

SelectedItemProperty

Metadata Flags

None

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.

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: