# GrapeCity.ActiveReports.Viewer.Win.Viewer.Action

## Content

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




<h1 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Action" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Action" class="text-break">Action Event
</h1>
<div class="markdown level0 summary"><p>Occurs when a report item, configured with an interactive action, is clicked within the report preview control.</p>
</div>
<div class="markdown level0 conceptual"></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_Action_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event EventHandler&lt;Viewer.ActionEventArgs&gt; Action</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.eventhandler-1">EventHandler</a>&lt;<a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.html">Viewer</a>.<a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.html">ActionEventArgs</a>&gt;</td>
      <td>Occurs when a report item, configured with an interactive action, is clicked within the report preview control.</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Action_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>This event is raised in response to user interactions with report items that have associated actions, such as hyperlinks or drill-through links.
The <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.Viewer.ActionEventArgs.html">Viewer.ActionEventArgs</a> provides details about the action to be performed, including any necessary parameters or identifiers.
Handlers for this event can perform custom processing, redirect actions, or cancel the default action execution
by setting the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.canceleventargs.cancel">Cancel</a> property of the event arguments.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Action_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>

</div>
