Main Content

setSelectedItems

Set values for a tree

Since R2019b

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 Simulink.dialog.Container.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'})

Version History

Introduced in R2019b