Change button text based on Context property

Lets say I have a datagrid with rows of opportunities and a button in the last column.
Depending on the OpportunityState the button text has to be changed to "Accept" or "Reject"

How can i achieve this?

    <RadzenGridColumn TItem="OpportunityEntity" Bubble="false" Filterable="false" Sortable="false" TextAlign="TextAlign.Center" Width="70px">
        <Template Context="opportunityEntity">

            @*@btntext = (@opportunityEntity.Reason == "High"? "Accept":"Reject")*@

            <RadzenButton ButtonStyle="ButtonStyle.Success" Text="@btntext" Icon="close" Size="ButtonSize.Small" Click="@((args) => Click(args, opportunityEntity, "Secondary button"))">
            </RadzenButton>
        </Template>
    </RadzenGridColumn>

Adding one more question.

On Clicking delete function from the button, I would expect the row to disappear from the grid since I am removing it from the List bound to the datagrid

async void OpportunityOperation(OpportunityEntity opportunityEntity, string Operation)
{
   opportunityEntities.Remove(opportunityEntity);

    service.OpportunityOperation(opportunityEntity, Operation);

    ShowNotification(new NotificationMessage() { Severity = NotificationSeverity.Info, Summary = "ABC", Detail = "Info Detail", Duration = 2000 });
}

It doesn't happen even in your example page after calling DeleteRow

void DeleteRow(Order order)
{
    dbContext.Remove<Order>(order);
    dbContext.SaveChanges();
}

Issue with delete in our demo confirmed - we will publish fix later today. You can execute Reload() for the DataGrid to fix it.

Demo fixed. Now the grid will be reloaded after delete.

Thanks @enchev

Please answer my first question too

@enchev Any update on the issue?

The issue with the demo was fixed immediately after your report.

@enchev There was one question and one issue I posted.

Please help with the below

Lets say I have a datagrid with rows of opportunities and a button in the last column.
Depending on the OpportunityState the button text has to be changed to "Accept" or "Reject"

How can i achieve this?

    <RadzenGridColumn TItem="OpportunityEntity" Bubble="false" Filterable="false" Sortable="false" TextAlign="TextAlign.Center" Width="70px">
        <Template Context="opportunityEntity">

            @*@btntext = (@opportunityEntity.Reason == "High"? "Accept":"Reject")*@

            <RadzenButton ButtonStyle="ButtonStyle.Success" Text="@btntext" Icon="close" Size="ButtonSize.Small" Click="@((args) => Click(args, opportunityEntity, "Secondary button"))">
            </RadzenButton>
        </Template>
    </RadzenGridColumn>

As far as I can see you already know how to access the context and you can set the property as any other Blazor component property. If you are looking for Radzen dedicated support you can find the options here: