Search code examples
kendo-uikendo-gridkendo-asp.net-mvckendo-ui-gridkendo-ui-mvc

Hide an element conditionally by its value


I have a kendo grid containing following columns.

1.Name

2.Age

3.Type{values:public,private}

I need to hide a column in specific row. In my problem, i want to hide age cell if Type value is private.


Solution

  • using if else format

     columns.Template(@<text></text>)
                            .ClientTemplate("#if (field == value) {#"
                            + "<a></a>"
                            + "#}else {#"
                            +"<input name='chkSubscribed' class='subscribedClass'type='type': '' #/>"
                            + "#} #").Width(130).Title("title");