I've recently started working with the grid component and have the need for custom templates for columns (checkboxes for booleans instead of true/false, slider for certain integer values etc).
When I set up a template for a column e.g. template: '<div style="text-align: center"><input type="checkbox" #= is_included ? checked="checked" : "" # /></div>' it displays as expected but any changes to the column are not reflected back in the datasource.
I've seen mention of this before in the forum and was wondering if it has been fixed and I'm missing a step and if it currently is something that's missing is it going to be added at some point.
Thanks for your help
5 Answers, 1 is accepted
As you may know in order to take advantage of Grid built-in editing capabilities, the particular item/cell should be set in edit mode. However, from the description you have given, I suspect that you are trying to update given model's fields while the grid is in display mode. In such case you will need to manually update the appropriate field using the DataSource API. Here is a basic implementation of such approach.All the best,
the Telerik team
As you mentioned, I am probably trying to do this in display mode (since I'm using the template property). Using your example worked as expected.
If I was to use my own column editors e.g. slider for updating a rating for instance, instead of using the display template is it possible to always have a grid in edit mode? Right now it's not obvious which columns are actually editable and once the user clicks on an editable column the change can completely change which can seem strange to a user e.g. when you click on an editable boolean column the true/false value just switches to a checkbox and a number changes to a numeric textbox etc.
I'm afraid that having all of Grid cells in edit mode is currently not possible.Regards,
the Telerik team
I have a ForeignKey column in editable grid.
I need to display editable dropdown control while clicking of checkbox(this is another boolean column) not clicking of foreignkey column.
Please check below link for demo/code.