How to add a checkbox to a Kendo UI MVC Grid

Ok took me a while to find this by piecing together information from various sources on the web.

 columns.Bound(p => p.Discontinued).ClientTemplate("<input type='checkbox' #= Discontinued ? checked='checked' : '' # ></input>")

Do you agree with this solution? Do you know a better way? Please feel free to leave a comment and help us all in our quest for perfect code :-)

Sources:

1 http://www.kendoui.com/forums/ui/grid/display-boolean-field-as-checkbox.aspx

2 http://www.kendoui.com/forums/ui/grid/how-to-add-checkbox-in-grid.aspx

comments powered by Disqus