All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Access a DashboardControl Instance

The sample below shows how you can access properties and call methods of a DashboardControl in an Angular application.

Pass a component name or a template reference variable to the @ViewChild decorator. Then use the component's instance property to access the underlying DashboardControl and its members.

import { Component, ViewChild } from "@angular/core";
import { DxDashboardControlComponent } from 'devexpress-dashboard-angular';
// ...
export class AppComponent {
    // ===== Pass a component name =====
    @ViewChild(DxDashboardControlComponent, { static: false }) dashboardComponent: DxDashboardControlComponent
    // ===== or use a template reference variable =====
    @ViewChild("targetDashboardControl", { static: false }) dashboardComponent: DxDashboardControlComponent

    reloadData() {
        this.dashboardComponent.instance.reloadData();
    }

}