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

making cell non-editable of the grid based on a condition

1 Answer 1206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dynamo
Top achievements
Rank 1
Dynamo asked on 15 Oct 2015, 11:06 AM

columns: [{field: "Version",
template: function (dataItem) {
                            if (kendo.htmlEncode(dataItem.Version) == "Pacing")
                            {//I want to make a cell read only if its text value is Pacing. I am able to make it bold but not read only.

                                //dataItem.Version.editable = true;

                               // return kendo.htmlEncode(dataItem.Version.editable(true));
                                return "<strong>" + kendo.htmlEncode(dataItem.Version) + "</strong>";
                            }
                        },
                        title: "Version", width: "110px", editable: true
                    },
                    { field: "Quarter1", title: "Quarter1", width: "110px", editable: true },

 Also I want some columns editable but I am not getting that by writing editable=true

Kindly help asap, need for a project

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 15 Oct 2015, 02:01 PM

Hello Dynamo,

Modifying the template of the column will not make it readonly. You should use the columns.editor property to achieve the task. Here is a sample implementation. Another possible solution would be to attach a handler to the edit event of the Grid and prevent the editing of the column in some cases.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Dynamo
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or