Occurs on the client side when the Scheduler control is about to change its active view.
The ActiveViewChanging event handler receives an argument of the ActiveViewChangingEventArgs type. The following properties provide information specific to this event.
|cancel||Gets or sets whether the change of active view should be canceled.|
|newView||Gets the new value of the ASPxScheduler.ActiveView property.|
|oldView||Gets the value of the ASPxScheduler.ActiveView property before modification.|
This event is a client-side counterpart of the ASPxScheduler.ActiveViewChanging event.
If the view is changed entirely on the client-side, using built-in scripts or the ASPxClientScheduler.SetActiveViewType method, the ActiveViewChangingEventArgs.oldView and the ActiveViewChangingEventArgs.newView event arguments contain view types for the view being changed and the target view, respectively. Context menus and View Selector elements use built-in scripts. Therefore, the ActiveViewChanging event is raised and you can determine old and new view types.
The Show more... button switches the view using client scripts, so it fires the ActiveViewChanging event in typical fashion.
If the end-user executes navigation commands, such as Go to This Day, Go to Today, or invokes the navigation dialog Go to Date..., then a corresponding callback command is executed first. Client scripts are not aware of the view type after a callback, so the ActiveViewChangingEventArgs.newView value within the event handler is undefined.
You can find an example of handling the ActiveViewChanging event in our Client Side - Active View Change demo, available online.