This is a migrated thread and some comments may be shown as answers.

Grid Batch Edit Disable Row

1 Answer 478 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 14 Jun 2012, 04:30 PM
Is there a way to disable a row in batch edit mode if the row has a specific column value?

1 Answer, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 18 Jun 2012, 05:00 PM
Jeff,

I had the same problem. I wanted to prevent certain rows from being edited, based on their state when they were retrieved from the database. I added a boolean field "IsReadOnly" to the object and set it before sending it back from the server.

In the client-side code, I ended up implementing the "edit" event of the grid like this:

edit: function (e) {
if (e.model.IsReadOnly) {
$('#myGrid').data("kendoGrid").closeCell();
}
}

It immediately closes the cell out of edit mode as soon as its clicked into. Not as elegant as preventing it from changing to the editable cell to begin with, but it happens fast enough it isn't visually noticable that it ever was anything but just the text.
Tags
Grid
Asked by
Jeff
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Share this question
or