Selection

The RadTreeListView provides you with a selection functionality, which allows the user to select one or more items from the data displayed by the control.

Selection Modes

The RadTreeListView provides three selection modes, which allow you to manipulate the type of selection. This is controlled by the SelectionMode enumeration property which has the following entries:

  • Single - only one item can be selected at a time. (default value)

  • Multiple - items are added to the selection when they get clicked and get removed when they get clicked again.

  • Extended - items are added to the selection only by combining the mouse clicks with the Ctrl or Shift key.

Selection Units

The RadTreeListView provides two selection units, which allow you to manipulate what units are selected when you interact with the grid. This is controlled by the SelectionUnit enumeration property which has the following entries:

  • FullRow - this is the default value. Clicking within the cells will select the row.

  • Cell - the clicked cell is selected only. Depending on the value of the SelectionModes property, you can have more than one selected cell.

Selected items

RadTreeListView provides several properties to get the data behind the selected items - SelectedItem, SelectedItems and SelectedCells.

  • SelectedItem - the business object that sits behind the selected row. You can use it when the SelectionUnit is set to FullRow (default), otherwise it is null.

  • SelectedItems - a collection of the business objects that sits behind the selected rows. You can use it when the SelectionUnit is set to FullRow (default), otherwise it is null. It will contain more than one item when the SelectionMode is either Multiple or Extended.

  • SelectedCells - a collection of GridViewCellInfo objects which represent the business object and the column of the selected cell/cells. You can use it when the SelectionUnit is set to Cell, otherwise it is null.

As the RadTreeListView directly inherits the RadGridView it uses its selection mechanism. The RadGridView allows you to implement programmatic selection, multiple selection and more. To learn more read the respective topics in the RadGridView's documentation.

See Also

In this article