Expanding or collapsing all chart nodes

You can expand or collapse all chart nodes in the tree or organization charts on a visual dashboard programmatically. See an example of expanding or collapsing the chart nodes on the basis of the DEMO.EMPLOYEE example project.

Before you begin

You must have a visual dashboard with an added Organization Chart or Tree Chart.

About this task

To expand or collapse all the chart nodes:

Procedure

  1. In the DEMO.EMPLOYEE example project, add a button and set its Caption value to Expand All.
  2. Add the action Set Values on the Click event with the expression:
    1. OrganizationChart1.DataLocator.ExpandedNodes=field("Query1", "EMPLOYEE_ID")
      Note: The separator in the expression depends on the locale settings.
  3. Add a button and set its Caption value to Collapse All.
  4. Add the action Set Values on the Click event with the expression:
    1. OrganizationChart1.DataLocator.CollapsedNodes=field("Query1", "EMPLOYEE_ID")
      Note: The separator in the expression depends on the locale settings.
  5. Click Runtime tab and expand all chart nodes by clicking the Expand All and collapse them all by clicking Collapse All.
    Note: If you add the example buttons to the Data Template they will work only with the node connected with this Data Template.