1

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.

  • Look [this post](http://stackoverflow.com/q/14221670/1267304) and tell if it helps. – DontVoteMeDown Nov 11 '13 at 13:04
  • possible duplicate of [Make cell readonly in Kendo Grid if condition is met](http://stackoverflow.com/questions/20881484/make-cell-readonly-in-kendo-grid-if-condition-is-met) – Lars Höppner May 06 '14 at 04:32

2 Answers2

1

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();
  }
}
Petur Subev
  • 19,983
  • 3
  • 52
  • 68
0

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

Rizier123
  • 58,877
  • 16
  • 101
  • 156
Preena Khanuja
  • 205
  • 2
  • 6
  • 14