| Visual Basic (Declaration) | |
|---|---|
Public Property SelectedItem As Object | |
| C# | |
|---|---|
public object SelectedItem {get; set;} | |
Return Value
A reference to the currently selected data item. Can be a null reference (Nothing in Visual Basic) an item other than a master data item is selected.The SelectedItems, SelectedItem, and SelectedIndex properties represent data items and not DataRows.
In the case where more than 1 data item is selected in a grid, the SelectedItem property will return the first data item in the SelectedItems collection and the SelectedIndex property will return the index of this same item.
The CurrentItem and SelectedItem properties may or may not be the same data item.
The CurrentItem and SelectedItem/SelectedItems properties must be set to a null reference (Nothing in Visual Basic) in order to reset them when the NavigationBehavior property is set to None.
Supported Frameworks: Microsoft .NET Framework version 3.5