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

Conditionally enable cell based on value of another

1 Answer 170 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 16 Jan 2015, 09:29 PM
I have the following grid:

@(Html.Kendo().Grid<MyApp.WebUI.Models.MyModel>()
                    .Name("grid")
                    .Columns(columns =>
                    {
                        columns.Bound(m => m.codeType).ClientTemplate("#=codeType.code_type#").Width(75);
                        columns.Bound(m => m.codeVersion).ClientTemplate("#=codeVersion.code_version#").Width(75);
                    })
                    .Editable(editable => editable.Mode(GridEditMode.InCell))
                    .Events(events => events.DataBound("onDataBound"))

Both columns use a combo box for the EditorTemplate.
I am looking for a solution that disables the 2nd column on default.  Then based on value selected for 1st column, column 2 is either enabled or stays disabled.

Any guidance would be much appreciated.

1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 20 Jan 2015, 01:46 PM
Hi Andrew,

You can use the edit event, where you can check the currently column being edited and the values in the model and either prevent the editing or allow it. Here is an example:

http://dojo.telerik.com/@Kiril/aqif

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or