Skip to main content

DataControlBase.SelectedItems Property

Gets data objects that correspond to rows (or nodes in TreeListView) currently selected within a View.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v14.2.Core.dll

#Declaration

[CloneDetailMode(CloneDetailMode.Skip)]
public IList SelectedItems { get; set; }

#Property Value

Type Description
IList

The list which contains data objects corresponding to selected rows.

#Remarks

The SelectedItems collection contains data objects which correspond to rows currently selected within a View. To select a row, use the GridViewBase.SelectRow method (TreeListView.SelectNode in TreeListView). To unselect a row, use the GridViewBase.UnselectRow method (TreeListView.UnselectNode in TreeListView).

To obtain handles of selected rows, use the DataControlBase.GetSelectedRowHandles method.

To learn more, see Obtaining Selected Rows and Cells.

NOTE

When engineering a XAML-based application using the Model View ViewModel (MVVM) architectural pattern, you may be required to specify selected items in a Model or ViewModel. In this instance, a collection of selected items should be initialized in the Model or View Model before it is bound to the grid's SelectedItems property. Otherwise, it will not be populated with items selected within the grid.

See Also