I am trying make the an editable grid to uneditable depend on conditions.
I have tried in jquery as below
var $grid = &(\"#gridName\").data(\"ken
to disable cell editing:
var len = $("#gridName").find("tbody tr").length;
for(var i=0;i<=len ; i++)
{
var model = $("#gridName").data("kendoGrid").dataSource.at(i);
if (model) {//field names
model.fields["DueDateStr"].editable = false;
model.fields["TotalAmount"].editable = false;
model.fields["IsPercentage"].editable = false;
}
}
to disabled check box control's which it in the template:
$.map($("#gridName").find("input:checkbox"),
function (item) {
$(item).attr('disabled', 'disabled');
}
);
to remove command buttons like delete button:
var rows = $('#gridName tbody tr');
$.map(rows, function (row) {
//cell buttons index
row.cells[4].innerHTML = "";
});
to hide toolbar grid:
$("#gridName .k-grid-toolbar").hide();