Dashboard.OptionsChanged Event

Occurs after any option in the current Dashboard is changed.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v20.1.Core.dll

Declaration

public event DashboardOptionsChangedEventHandler OptionsChanged
Public Event OptionsChanged As DashboardOptionsChangedEventHandler

Event Data

The OptionsChanged event's handler receives an argument of the DashboardOptionsChangedEventArgs type.

Remarks

The event occurs after any action is added to dashboard history and fires only for the current dashboard.

In the UI, when you use the Open command, the dashboard instance remains the same and the OptionsChanged event continues to occur for the opened dashboard. The New command creates a new dashboard instance and you need to handle the OptionsChanged event again.

To detect changes for any dashboard, fire the designer's DashboardDesigner.DashboardOptionsChanged event. You can also use the DashboardDesigner.IsDashboardModified property to indicate changes made in the DashboardDesigner UI since the last save.

The example below shows how to handle the OptionsChanged event to check the actual dashboard state.

dashboardDesigner1.Dashboard.OptionsChanged += Dashboard_OptionsChanged;  

private void Dashboard_OptionsChanged(object sender, DashboardOptionsChangedEventArgs e) {  
    this.BeginInvoke((Action)(() => {  
        bool hasUndo = undoBarItem1.Enabled;  
        bool hasRedo = redoBarItem1.Enabled;  
        Debug.WriteLine($"Undo = {hasUndo}, Redo = {hasRedo}");  
    }));  
} 
See Also