I have a kendo grid containing following columns.
1.Name
2.Age
3.Gender{checkbox(male, female)}
I need to hide a column in specific row. In my problem, want to hide Gender cell which contain checkbox if Age value equal to 18 or 19 or 20.
I have a kendo grid containing following columns.
1.Name
2.Age
3.Gender{checkbox(male, female)}
I need to hide a column in specific row. In my problem, want to hide Gender cell which contain checkbox if Age value equal to 18 or 19 or 20.
As @Carsten said, you can't hide a cell, but only hide it's content. You can use a template
for that:
template: "# if (data.Age < 18 || data.Age > 20) { #<input type='checkbox' name='Gender'># } #"
In your case, using Asp.Net MVC you should use ClientTemplate
. Something like this(can't test it):
columns.Bound(p => p.Gender).ClientTemplate("# if (data.Age < 18 || data.Age > 20) { #<input type='checkbox' name='Gender'># } #")
You can't hide the cell but you can hide the content depending of the other columns. See https://docs.telerik.com/aspnet-mvc/helpers/grid/faq#how-to-apply-conditional-logic-to-client-column-templates on how to apply conditional logic to columns.