Main Content

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 thegetDialogControlcommand to get the tree handle. For more information, seegetDialogControl.

For example,treeControl = maskObj.getDialogControl('TreeControl'). Here,maskObjis the mask object andTreeControlis 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 itemstreeControl.setSelectedItems({'Node1/ChildNode1','Node1/ChildNode2'})

Version History

Introduced in R2019b