Skip to main content
All docs
V25.1
  • XRControl.Action Property

    Specifies the action assigned to the control.

    Namespace: DevExpress.XtraReports.UI

    Assembly: DevExpress.XtraReports.v25.1.dll

    NuGet Package: DevExpress.Reporting.Core

    Declaration

    [DefaultValue(null)]
    [SRCategory(ReportStringId.CatBehavior)]
    public virtual XRAction Action { get; set; }

    Property Value

    Type Default Description
    XRAction null

    An action assigned to the control.

    Remarks

    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;
    
            }
        }
    }
    

    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.

    Drill-through Category report

    A Breadcrumb control automatically appears below the Document Viewer toolbar and allows you to navigate back to the original report.

    Detail Product report

    Review the following tutorial for more information on how to implement drill-through functionality in the UI: Create Drill-Through Reports.

    See Also