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();
}