# GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs" class="text-break">Viewer.ActionEventArgs Class
</h1>
  <div class="markdown level0 summary"><p>Provides data for the Action event, encapsulating details about an action that should be performed.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.eventargs">EventArgs</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.canceleventargs">CancelEventArgs</a></div>
    <div class="level3"><span class="xref">Viewer.ActionEventArgs</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.html">GrapeCity.ActiveReports.Viewer.Win</a></h6>
  <h6><strong>Assembly</strong>: MESCIUS.ActiveReports.Viewer.Win.dll</h6>
  <h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Viewer.ActionEventArgs : CancelEventArgs</code></pre>
  </div>
  <h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs_examples"><strong>Examples</strong></h5>
  <pre><code class="lang-csharp">// 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 &gt;= 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}");
}</code></pre>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs__ctor" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.#ctor">
          <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.-ctor.html#GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs__ctor">ActionEventArgs()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.html">Viewer.ActionEventArgs</a> class.
This default constructor initializes the instance without specifying an action or page number.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs__ctor_GrapeCity_Viewer_Common_Model_Interactivity_IAction_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.#ctor(GrapeCity.Viewer.Common.Model.Interactivity.IAction)">
          <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.-ctor.html#GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs__ctor_GrapeCity_Viewer_Common_Model_Interactivity_IAction_">ActionEventArgs(IAction)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.html">Viewer.ActionEventArgs</a> class with the specified action.
This constructor is used when an action is defined without a specific page navigation.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs__ctor_GrapeCity_Viewer_Common_Model_Interactivity_IAction_System_Int32_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.#ctor(GrapeCity.Viewer.Common.Model.Interactivity.IAction,System.Int32)">
          <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.-ctor.html#GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs__ctor_GrapeCity_Viewer_Common_Model_Interactivity_IAction_System_Int32_">ActionEventArgs(IAction, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.html">Viewer.ActionEventArgs</a> class with the specified action and page number.
This constructor is used when the action involves navigating to a specific page.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs_Action" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.Action">
          <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.Action.html#GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs_Action">Action</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the action that should be performed in response to this event.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs_PageNumber" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.PageNumber">
          <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.PageNumber.html#GrapeCity_ActiveReports_Viewer_Win_Viewer_ActionEventArgs_PageNumber">PageNumber</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the page number in the current layout tree that should be navigated to.
This property is relevant when the action involves navigating to a specific page.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
