Back to Devexpress

Dashboard.OptionsChanged Event

dashboard-devexpress-dot-dashboardcommon-dot-dashboard-f9b203a5.md

latest4.6 KB
Original Source

Dashboard.OptionsChanged Event

Occurs after any option in the current Dashboard is changed.

Namespace : DevExpress.DashboardCommon

Assembly : DevExpress.Dashboard.v25.2.Core.dll

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public event DashboardOptionsChangedEventHandler OptionsChanged
vb
Public Event OptionsChanged As DashboardOptionsChangedEventHandler

Event Data

The OptionsChanged event's data class is DashboardOptionsChangedEventArgs.

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.

csharp
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}");  
    }));  
}
vb
Private dashboardDesigner1.Dashboard.OptionsChanged += Dashboard_OptionsChanged

Private Sub Dashboard_OptionsChanged(ByVal sender As Object, ByVal e As DashboardOptionsChangedEventArgs)
    Me.BeginInvoke(CType(Function() AnonymousMethod1(), Action))
End Sub

Private Function AnonymousMethod1() As Boolean
    Dim hasUndo As Boolean = undoBarItem1.Enabled
    Dim hasRedo As Boolean = redoBarItem1.Enabled
    Debug.WriteLine($"Undo = {hasUndo}, Redo = {hasRedo}")
    Return True
End Function

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the OptionsChanged event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/CS/MultiPaneExtension/MultiPaneModule.cs#L49

csharp
dashboardDesigner.DashboardItemSelected += DashboardDesigner_DashboardItemSelected;
    dashboardDesigner.Dashboard.OptionsChanged += Dashboard_OptionsChanged;
}

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/VB/MultiPaneExtension/MultiPaneModule.vb#L46

vb
AddHandler dashboardDesigner.DashboardItemSelected, AddressOf DashboardDesigner_DashboardItemSelected
    AddHandler dashboardDesigner.Dashboard.OptionsChanged, AddressOf Dashboard_OptionsChanged
End If

See Also

Dashboard Class

Dashboard Members

DevExpress.DashboardCommon Namespace