Back to Devexpress

TreeList.SelectCells(TreeListNode, TreeListColumn, TreeListNode, TreeListColumn) Method

windowsforms-devexpress-dot-xtratreelist-dot-treelist-dot-selectcells-x28-treelistnode-treelistcolumn-treelistnode-treelistcolumn-x29.md

latest4.6 KB
Original Source

TreeList.SelectCells(TreeListNode, TreeListColumn, TreeListNode, TreeListColumn) Method

Selects cells in the specified range.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
public void SelectCells(
    TreeListNode startNode,
    TreeListColumn startColumn,
    TreeListNode endNode,
    TreeListColumn endColumn
)
vb
Public Sub SelectCells(
    startNode As TreeListNode,
    startColumn As TreeListColumn,
    endNode As TreeListNode,
    endColumn As TreeListColumn
)

Parameters

NameTypeDescription
startNodeTreeListNode

A node containing the cell that specifies the starting point of the range to select.

| | startColumn | TreeListColumn |

A column containing the cell that specifies the starting point of the range to select.

| | endNode | TreeListNode |

A node containing the cell that specifies the end point of the range to select.

| | endColumn | TreeListColumn |

A column containing the cell that specifies the end point of the range to select.

|

Remarks

The SelectCells method selects multiple cells in the specified range. The start and end points of the range are specified using the cells located at the intersection of the nodes (rows) and columns passed as parameters. To discard the selection, use the TreeList.UnselectCell or TreeList.UnselectCells methods.

The code snippet below shows how to select a particular range of cells in the TreeList using the SelectCells method.

csharp
treeList1.SelectCells(treeList1.Nodes[0].Nodes[0], treeList1.Columns[1], treeList1.Nodes[0].Nodes[1], treeList1.Columns[2]);
vb
treeList1.SelectCells(treeList1.Nodes[0].Nodes[0], treeList1.Columns[1], treeList1.Nodes[0].Nodes[1], treeList1.Columns[2])

The figure below shows the selected range of cells.

After the selection is changed, the TreeList.SelectionChanged event is raised.

Note

The SelectCells method is not in effect if multiple cell selection is disabled. This mode can be enabled by setting the TreeListOptionsSelection.MultiSelect property to true and the TreeListOptionsSelection.MultiSelectMode property to CellSelect.

See Also

SelectCell(TreeListNode, TreeListColumn)

UnselectCell(TreeListNode, TreeListColumn)

UnselectCells

SelectionChanged

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace