Class ActionBeginningEventArgs
Provides data for the ActionBeginning event, raised before a Spreadsheet action is executed.
Inherited Members
Namespace: Syncfusion.Blazor.Spreadsheet
Assembly: Syncfusion.Blazor.Spreadsheet.dll
Syntax
public class ActionBeginningEventArgs : ActionCompletedEventArgs
Remarks
This class contains information about a Spreadsheet action that is about to be performed.
It inherits the action name, selected range, and worksheet name from ActionCompletedEventArgs, and adds the ability to cancel the action by setting Cancel to true.
Use this event to validate conditions, monitor user activity, enforce business rules, or cancel Spreadsheet operations before they are executed.
Examples
This example demonstrates how to prevent clear operations.
<SfSpreadsheet ActionBeginning="OnActionBeginning">
<SpreadsheetRibbon></SpreadsheetRibbon>
</SfSpreadsheet>
@code {
private void OnActionBeginning(ActionBeginningEventArgs args)
{
if (args.Action == "Clear")
{
args.Cancel = true;
}
}
}
Constructors
ActionBeginningEventArgs()
Declaration
public ActionBeginningEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the action should be cancelled.
Declaration
public bool Cancel { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | A bool indicating whether to cancel the operation. The default value is false. |
Remarks
Setting this property to true prevents the requested Spreadsheet action from executing.
This property is only available on ActionBeginningEventArgs because the action can only be cancelled before it runs.