xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrcontrol-76584aff.md
Specifies the action assigned to the control.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[DefaultValue(null)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual XRAction Action { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(Nothing)>
Public Overridable Property Action As XRAction
| Type | Default | Description |
|---|---|---|
| XRAction | null |
An action assigned to the control.
|
You can use the Action property of report controls (XRControl descendants, such as XRTableCell and XRLabel) to create drill-through reports. The Action property provides access to NavigateToReportAction. NavigateToReportAction allows you to specify the detail report instance or URL to define a master-detail relationship and obtain a collection of detail report parameter bindings.
The following code snippet shows how to define master-detail relationships between Category and Product reports within a single project:
using DevExpress.XtraReports.Interactivity;
using DevExpress.XtraReports.UI;
namespace Drill_through_example {
public partial class XtraReportCategories : DevExpress.XtraReports.UI.XtraReport {
public XtraReportCategories(){
InitializeComponent();
// Create a NavigateToReportAction instance and specify its settings
NavigateToReportAction cellAction = new NavigateToReportAction();
cellAction.ReportSource = new XtraReportProducts();
// Assign the NavigateToReportAction object to the control’s Action property
tableCell6.Action = cellAction;
}
}
}
Imports DevExpress.XtraReports.Interactivity
Imports DevExpress.XtraReports.UI
Namespace Drill_through_example
Partial Public Class XtraReportCategories
Inherits DevExpress.XtraReports.UI.XtraReport
Public Sub New()
InitializeComponent()
' Create a NavigateToReportAction instance and specify its settings
Dim cellAction As New NavigateToReportAction()
cellAction.ReportSource = New XtraReportProducts()
' Assign the NavigateToReportAction object to the control’s Action property
tableCell6.Action = cellAction
End Sub
End Class
End Namespace
When you switch to the preview, you can now click on the Category value in the table and navigate to the detail report that contains Product values.
A Breadcrumb control automatically appears below the Document Viewer toolbar and allows you to navigate back to the original report.
Review the following tutorial for more information on how to implement drill-through functionality in the UI: Create Drill-Through Reports.
See Also