DxReportViewer.OnPreviewDoubleClick Event
Occurs when a user double-clicks a report document.
Namespace: DevExpress.Blazor.Reporting
Assembly: DevExpress.Blazor.Reporting.v25.2.Viewer.dll
NuGet Package: DevExpress.Blazor.Reporting.Viewer
Declaration
[Parameter]
public EventCallback<PreviewClickEventArgs> OnPreviewDoubleClick { get; set; }
Parameters
| Type | Description |
|---|---|
| PreviewClickEventArgs | The event data. |
Remarks
The following code snippet handles the OnPreviewDoubleClick event. The sample report contains two labels (“Label 1” and “Label 2”). The Clicked variable displays the clicked label or “Empty area”. When “Label 2” is double-clicked, the Handled property is set to true to prevent default actions.
@using DevExpress.Blazor.Reporting.Models
@using DevExpress.XtraReports.UI
@using DxBlazorApplication.PredefinedReports
<div>Clicked: @Clicked</div>
<DxReportViewer Report="@Report"
OnPreviewDoubleClick="OnPreviewDoubleClick"/>
@code {
private string? Clicked;
XtraReport Report = new TestReport(); // Contains "Label 1" and "Label 2"
private async Task OnPreviewDoubleClick(PreviewClickEventArgs args) {
if (args.Brick is null) {
Clicked = "Empty area";
return;
}
else if (args.Brick.Text == "Label 1") {
Clicked = "First Label";
return;
}
else if (args.Brick.Text == "Label 2") {
Clicked = "Second Label";
args.Handled = true;
return;
}
await Task.CompletedTask;
}
}
See Also