setSelectedItems(TreeControl)

Class: Simulink.dialog.TreeControl
Package: Simulink.dialog

Set values for a tree

Syntax

treeControl.setSelectedItems({'Node1/ChildNode1','Node1/ChildNode2'})

Description

treeControl.setSelectedItems({'Node1/ChildNode1','Node1/ChildNode2'})set the values for the selected items in the tree.

Input Arguments

expand all

Handle to the tree, specified as an object. You can use the getDialogControl command to get the tree handle. For more information, see getDialogControl.

For example, treeControl = maskObj.getDialogControl('TreeControl'). Here, maskObj is the mask object and TreeControl is the name of the tree.

Data Types: cell array

Value to be set for selected items in the tree.

Examples

maskObj = Simulink.Mask.get( gcb );
treeControl = maskObj.getDialogControl('Control2')


% Set selected items
treeControl.setSelectedItems({'Node1/ChildNode1', 'Node1/ChildNode2'})

Introduced in R2019b