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

Column that is read-only in edit mode, but can change the value programatically

3 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 22 Jul 2014, 08:52 AM
Hi, I have a grid checkbox column that i want to stay read-only in edit mode; but i want to programatically change the value (mode.set) - and have it reflect on the grid.
How can i achieve this?

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 23 Jul 2014, 12:14 PM
Hello Tom,


In this case the property should be set as editable in the model (which is the default configuration). Additionally you could use the edit event of the Grid, which is fired when it enters edit mode, access the editor container via the e.container parameter, retrieve the checkbox and apply the readonly attribute.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tom
Top achievements
Rank 1
answered on 29 Jul 2014, 06:00 AM
Hi Dimiter, that could be a workaround... what I'm really looking for is a way to completely prevent the column going into edit mode - because I show a 'tick' image for my boolean column and want that to remain, even after i call grid.editRow(). 
~gilbert
0
Dimiter Madjarov
Telerik team
answered on 29 Jul 2014, 11:02 AM
Hi Tom,


When InLine edit mode is used, the whole row is switched to edit mode and this behavior cannot be prevented. You could use the e.container parameter and manually append the image to the cell in the edit event handler.

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
Tom
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Tom
Top achievements
Rank 1
Share this question
or