1
votes

I am trying to enable or disable kendo grid Cell depend on other value in same row in MVC. I have tried

grid.dataSource.at(i).fields["colname"].editable = true;

but it affects all the rows column. I want only selected row's cell should disable/enable.

Thanks for help.

2
Look this post and tell if it helps.DontVoteMeDown

2 Answers

1
votes

I would suggest using the edit event of the Grid and close the cell based on your condition. Same question is discussed here.

$("#grid").kendoGrid({
  //....
  edit: onEdit
});

function onEdit(e) {
  if(...your custom logic){
     $('#grid').data("kendoGrid").closeCell();
  }
}
0
votes

you can pick up the selected row by .select() and then disable your cell. for e.g

var grid = $("#grdName").data("kendoGrid");
        var selectItem = grid.dataItem(grid.select());

this will give u the selected row and then you can disable/enable the cells