ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer.ActionEventArgs Class
Members Example

In This Topic
    Viewer.ActionEventArgs Class
    In This Topic
    Provides data for Action event.
    Object Model
    Viewer.ActionEventArgs Class
    Syntax
    'Declaration
     
    Public Class Viewer.ActionEventArgs 
       Inherits System.ComponentModel.CancelEventArgs
    public class Viewer.ActionEventArgs : System.ComponentModel.CancelEventArgs 
    Example
    // Assuming 'viewer' is your Viewer control instance
    viewer.Action += Viewer_CustomActionTriggered;;
    // Handler for the CustomActionTriggered event
    private void Viewer_CustomActionTriggered(object sender, ActionEventArgs e)
    {
    	var viewer = (Viewer)sender;
    	// Check if there's a specific action defined
    	if (e.Action != null)
    	{
    	    // Handle the custom action
    	    HandleCustomAction(e.Action);
    	}
    	else if (e.PageNumber >= 0)
    	{
    	    // Navigate to the specified page number if no specific action is defined
    	    viewer.CurrentPage = e.PageNumber;
    	}
    }
    // Example method to handle a custom action
    private void HandleCustomAction(IAction action)
    {
    	// Implement custom action handling logic here
    	// This could involve checking the type of action and responding accordingly
    	Debug.WriteLine($"Handling custom action: {action.GetType().Name}");
    }
    Inheritance Hierarchy

    System.Object
       System.EventArgs
          System.ComponentModel.CancelEventArgs
             GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs

    See Also