Completed
Last Updated: 21 Jun 2017 03:34 by ADMIN
madcamp
Created on: 20 Aug 2015 13:51
Category: UI for ASP.NET MVC
Type: Feature Request
111
Conditional for Grid Columns and Buttons
It would be great to have the ability to have to conditionally set behavior for columns and buttons.

On a Grid with this:
.Columns(columns =>
{
  columns.Bound(b => b.IsEditable).Hidden(true);
  columns.Bound(b => b.Id);
  columns.Bound(b => b.Description).Width(200);
  columns.Command(c=>
        {
              c.Edit();
        });
})

Today if I want to hide a button depending on a cell value I need to do it on databound event.
It would be great to have the option to set something like:
command.Edit().Display(p => p.IsEditable); 

For a column, it would be nice to have something like:
columns.Bound(b => b.Description).Width(200).Editable(p => p.IsEditable);
6 comments
ADMIN
Petyo
Posted on: 03 Feb 2017 10:46
Shipped - check these two related articles:

http://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/editing/conditionally-editable-columns 
http://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/editing/show-command-buttons-conditionally
Imported User
Posted on: 08 Dec 2016 11:04
I've just started work with KendoGrids for like 3 days ago and after getting DB/filtering up and running,  landed on this very problem and shocked this is not an out of the box feature.

Buttons is one aspect, Check boxes, links, etc etc, anything that the data must drive. 

Imported User
Posted on: 01 Dec 2016 13:19
Really a big f**ing sheet without this functionality! If I was your boss, I would not pay you any coin salary
Bob
Posted on: 17 Sep 2016 22:49
Do this already!!! Piss on you for not having this out of the box!
Greg
Posted on: 13 Apr 2016 16:26
A workaround, however "kludgey", is discussed here:
http://www.telerik.com/forums/hide-edit-and-delete-button-based-on-the-status-of-each-record

Keep in mind that simply binding to the DataBound event of the grid to hide the command button(s) is not enough - they will reappear if an edit is cancelled.  You'll have to implement the hack described by Vladimir Iliev in the forum thread.
Jose
Posted on: 16 Mar 2016 18:04
is there any workaround implemented yet?