I've built my own validation mechanism for the DataGrid which displays ValidationResults in a blazorise Alert. I would like to Hide() the alert when a user wants to cancel editing a row.
Pressing Cancel goes through to context.Clicked which I can't override without breaking the row cancellation. How would I add functionality to the cancel request?
Alternatively can you provide an OnCancelingEdit event that I can use in a future release?
Context is used to handle the events by the outside components. Nothing stops you from using your own event handlers.
eg.
void MyCancelHandler( CommandContext commandContext )
{
alert.Hide();
commandContext.Clicked.InvokeAsync( null );
}
<CancelCommandTemplate>
<Button Color="Color.Secondary" Clicked="@((e)=>MyCancelHandler(context))">Cancel</Button>
</CancelCommandTemplate>
Most helpful comment
Context is used to handle the events by the outside components. Nothing stops you from using your own event handlers.
eg.