3
votes

I am using the kendo ui web grid. I am trying to figure out how to make one column editable and another not editable. Teleriks documentation seem to only covers the case when you are declaring your own dataSource object. But I am using the MVVM declarative binding. So I don't explicitly create a dataource. And for this scenario I can only find documentation for setting the entire grid as editable (by setting the config of the kendoGrid initialization to editable:true), not how to selectively setting specific columns as editable/non-editable.

Can anyone help me out here?

(Telerik should really look over their their documentation, seems like all of the api doc and how-to's are focused on the less elegant programatical binding with datasource object, which leaves one clueless regarding how to accomplish the same thing with MVVM binding).

1

1 Answers

3
votes

You can either try and create Template column (column which you do not specify field just template) or you set the editable option in your dataSource configuration to false.

var dataSource = new kendo.data.DataSource({
    schema: {
        model: {
            id: "ProductID",
            fields: {
                 ProductID: {
                    //this field will not be editable (default value is true)
                    editable: false
                 }
           }
       }
   }

});