Completed
Last Updated: 13 May 2021 07:29 by ADMIN
Vivek
Created on: 08 May 2014 04:59
Category: UI for ASP.NET MVC
Type: Feature Request
8
Ability to hide custom buttons like Edit based on conditions should be straight forward e.g. Command(cmd => cmd.Custom("Edit").Click("
Ability to hide buttons like edit based on conditions should be straight forward like this:

command(cmd => cmd.Custom("Edit").Click("blah").Visible(condition => condition.Status == "Current")
2 comments
ADMIN
Viktor Tachev
Posted on: 13 May 2021 07:29

Hi Vivek,

 

The command visibility can be controlled via the Visible option. It accepts the name of a JavaScript handler where you can specify a condition that determines if a command button should be visible:

 

Command configuration:

columns.Command(command => { command.Edit(); command.Destroy().Visible("isVisible"); });

JavaScript:

function isVisible(dataItem) {
	return dataItem.ProductID != 1;
}

 

Regards,
Viktor Tachev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Telerik Admin
Posted on: 09 May 2014 14:31
Thanks for this idea.

Presently you can achieve this functionality programmatically as explained in this forum thread:
http://www.telerik.com/forums/how-do-i-conditional-set-the-visibility-of-the-command-edit-button-on-a-row-by-row-basis-