Saving the chart nodes state

You can save the chart nodes state in the Tree Chart or Organization Chart on a visual dashboard programmatically. See an example of saving the chart nodes state 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 save the chart nodes state:

Procedure

  1. In the DEMO.EMPLOYEE example project, add two global parameters ExpandedNodesSaved and CollapsedNodesSaved of the Text type.
  2. Add two buttons to the project: Button1 and Button2.
  3. For Button1 specify the Caption property as Save.
  4. Add the action Set Values on the Click event. In the Add New Action wizard specify two actions:
    1. ExpandedNodesSaved=OrganizationChart1.DataLocator.ExpandedNodes
    2. CollapsedNodesSaved=OrganizationChart1.DataLocator.CollapsedNodes
  5. For Button2 specify the Caption property as Load.
  6. Add the action Set Values on the Click event. In the Add New Action wizard specify two actions:
    1. OrganizationChart1.DataLocator.ExpandedNodes=ExpandedNodesSaved
    2. OrganizationChart1.DataLocator.CollapsedNodes=CollapsedNodesSaved
      Note: At first, it is necessary to bind the value of ExpandedNodes, and then the value of the CollapsedNodes property.
  7. Click Runtime tab. Expand and collapse the nodes. Click the Save button to write the nodes state to the global parameters.
  8. Expand and collapse the nodes, click the Load button to restore the tree to the state saved by clicking the Save button.