TreeList.EnableSelectedHighlight

Syntax

EnableSelectedHighlight: Boolean

Description

The EnableSelectedHighlight property determines if selected tree nodes can be highlighted.

Comments

If the property is set to True, highlighting of selected tree nodes is available. By default this property is set to false.

By default this property is set to false.

To use highlighting, set the TreeNode.Highlighted property to true. Highlighting color and font are selected in the TreeList.SelectedHighlightColor and TreeList.SelectedHighlightFont properties respectively.

Example

To execute this example, the page must contain the TreeList component named treeListSett (see an example of the TreeList.NodeUnHovered event). The page must contain DIV elements with the identifiers but1 and but2. Add two buttons:

var but1 = new PP.Ui.Button(
{
    ParentNode: document.getElementById("but1"),
    Content: "Select by keys",
    Click: function ()
    {
        treeList.expandToKeyNode("n2");//expand the tree to node with a key "n2"
        treeList.setMultiSelect(true);//enable multiple node selection
        treeList.setSelectedByKeys(["n1", "n2"]);//key array of selected nodes
    }
});
var but2 = new PP.Ui.Button(
{
    ParentNode: document.getElementById("but2"),
    Content: "Highlight",
    Click: function ()
    {
        for (var i = 0; i < treeList.getSelectedNodesCount(); i++)
        {
            treeList.getSelectedNodes()[i].setHighlighted(true)//set highlight for selected nodes
        };
        treeList.setSelectedHighlightColor("#00BFFF");//highlight color
        treeList.setSelectedHighlightFont(new PP.Font(//text font of highlighted nodes
        {
            IsItalic: true//italic
        }));
    }
});

After executing the example on clicking the Select By Keys button the tree expands up to the node with the key n2, and the nodes with the keys n1 and n2 are selected. Clicking the Highlight button highlights selected nodes.

See also:

TreeList