This is a migrated thread and some comments may be shown as answers.

Change the command button content base on row value

1 Answer 725 Views
Grid
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 14 Nov 2019, 08:42 PM

I'm trying to change the content of a GridCommandButton based upon a value from the current row - 

I was thinking it would be something like this:

<GridCommandButton Command="Custom" Icon="edit" OnClick="@DisableIntegrator">

<Template>
@{
var integrator = context as Integrator;
integrator.IsActive ? "Deactivate" : "Activate";
}
</Template>



</GridCommandButton>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 18 Nov 2019, 03:10 PM

Hi William,

Please Vote for and Follow the feature request that will enable this here: https://feedback.telerik.com/blazor/1422740-conditional-command-buttons-shown-on-condition-based-on-model-values-and-or-invoking-cud-operations-programmatically.

In the meantime, since this seems to invoke some custom method, you can do this for a button in the Template of a regular column, not in a command column. The downside is that it will require two columns until the feature above gets implemented.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Tags
Grid
Asked by
William
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or