Grid Cell disabling based on a condition

1 Answer 6383 Views
Grid
Dynamo
Top achievements
Rank 1
Dynamo asked on 14 Oct 2015, 06:45 AM

I have to disable and enable cells of the grid under the same columns based on date validations. Is it possible to  do that in Kendo Grid?

I am new to Kendo UI and not getting proper examples for doing this.

P.s.Any proper example explaining this will be really  helpful.

1 Answer, 1 is accepted

Sort by
1
Konstantin Dikov
Telerik team
answered on 15 Oct 2015, 12:55 PM
Hello Dynamo,

For achieving the desired functionality you should handle the Edit event and use the model to retrieve the relevant information from the other cells and if the cell should not be edited, you could use the grid closeCell method.

Following is a dojo example with such conditional editing:
Hope this helps.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Adam
Top achievements
Rank 2
commented on 19 Nov 2020, 05:46 PM

I know this post is old but how can this be achieved if gridmode = "inline" I cannot find a way to prevent edits.
Aleksandar
Telerik team
commented on 23 Nov 2020, 01:26 PM

Hello Adam,

A possible approach would be to add a disabled attribute to the required input based on a condition:

editable: "inline",
edit: function(e) {
      if (e.model.age > 32) {
        e.container.find("input[name='name']").attr('disabled',true);
      }  
  }

Here is the previously sent example with the above modification.

Alternatively, you can try the approach discussed in this SO thread.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Melinda
Top achievements
Rank 1
commented on 11 Dec 2021, 09:48 AM

Hey!

I just wanted to find a way to disable editing my entire grid, and I found it here.

Thank You!

Tags
Grid
Asked by
Dynamo
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or