I have a Blazor date grid. Using the Rowbound event I hide most of the command buttons
public void RowBound(RowDataBoundEventArgs<Project> Args)
{
if ( some criterion)
{
Args.Row.AddClass(new string[] { "e-removeCommand" });
}
}
That all works fine.
When I execute the command I run in OnCommandClick:
public async void OnCommandClicked(CommandClickEventArgs<Project> args)
{
DO some work
if (result == "OK")
{
await DialogService.AlertAsync("It worked", "Data editor");
}
else
await DialogService.AlertAsync("It failed. Error is: " + result, "Data editor");
}
In the if result =="OK" clause I would like to hide the command button i.e. do
.AddClass(new string[] { "e-removeCommand" })
To teh command button that has just executed succesfully.
How might achieve this? I thought I might be able to use the Target property of the args to get at the command button but you have indicated it is deprecated and it appears to be null.
Any suggestions greatfully received.