The following example demonstrates how to implement custom saving and opening procedures in Dashboard Designer using the DashboardSaving and DashboardOpening events respectively.
In this example, the dashboard XML definition can be saved (opened) only to(from) the specified default location.
The DashboardSaving event is handled to implement a custom saving routine. Its DashboardSavingEventArgs.Command event parameter allows determining what user action raises the event. The Dashboard.SaveToXml method is used to save the dashboard to the specified XML file. Then, the DashboardSavingEventArgs.Handled event parameter is used to specify that the dashboard has been saved and no default actions are required.
Clicking the Save As button invokes a message box that allows saving the dashboard to the default location or cancel the saving procedure. The DashboardSavingEventArgs.Saved event parameter is used to notify whether the custom saving routine has succeeded.
The DashboardOpening event is handled to implement a custom opening procedure. The DashboardDesigner.LoadDashboard method is called to load the dashboard from the default location. The DashboardOpeningEventArgs.Handled event parameter allows specifying that no default actions are required to open the dashboard.
Question Comments
Added By: Julio Loya Medina at: 3/24/2014 5:03:11 PM
Hello.
Does this also works for Web applications?.
Or is there some other example?
This functionality is only applicable for WinForms Dashboard Designer. The DashboardOpening/DashboardSaving events are raised when an end-users clicks the Open/Save/Save As buttons in the Dashboard Designer application.