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

Conditional column control type

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 06 Mar 2014, 05:02 PM
I am using Kendo UI for the web and was wondering if there is a way to have a column either be a checkbox or a textbox depending upon the value of another  column in the grid. For example if column 1 = 'C' display a checkbox in column 2, if column 1 = 'T' display a textbox in column 2. This field will be the only field that is editable in the grid. .

 I assume I would need a template for this, but could not get anything to work. Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 07 Mar 2014, 01:52 PM
Hello Steven,

There is no problem to use a column template with an IF statement (or any other Javascript code) inside it.

http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.template

http://docs.telerik.com/kendo-ui/getting-started/framework/templates/overview#template-syntax

In case you want to change the column editor depending on a value in the data item, then you need a custom editor.

http://demos.telerik.com/kendo-ui/web/grid/editing-custom.html

http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.editor

Let me know if you need additional clarifications.

Regards,
Dimo
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
Steven
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or