Completed
Last Updated: 08 Jun 2017 13:07 by ADMIN
Dave
Created on: 28 Aug 2012 10:30
Category: Grid
Type: Feature Request
35
Grid: Add an easy way to hide command buttons based on model data
Very often in grids we want command buttons disabled (or not even visible) depending upon model data, such as Delete not being available if the data has certain values set. Something like:

columns.Command(commands => {
  commands.Edit();
  commands.Destroy().VisibleIf(model => model.IsPosted)
  });

Using HtmlAttributes would be acceptable if it was easy to access the model. I'm currently achieving this by using a client template and rendering the buttons myself, but this seems overly complex for what is a simple occurance.
2 comments
ADMIN
Pavlina
Posted on: 08 Jun 2017 13:07
Shipped: http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.command.visible
ASG
Posted on: 02 Dec 2015 17:58
Would also be helpful if you could do the same for Toolbar buttons. We have permissions that allow certain users to create items e.g.

.ToolBar(t => t.Create().Visible(IsAdminUser))