TreeList.SelectCells(TreeListNode, TreeListColumn, TreeListNode, TreeListColumn) Method
Selects cells in the specified range.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v24.2.dll
Declaration
public void SelectCells(
TreeListNode startNode,
TreeListColumn startColumn,
TreeListNode endNode,
TreeListColumn endColumn
)
Parameters
Name | Type | Description |
---|---|---|
startNode | TreeListNode | 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.
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.