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

Trouble when adding a new row to grid with embedded editor template

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joonu
Top achievements
Rank 1
Joonu asked on 08 Mar 2013, 11:03 AM

Hi,

We are facing an issue with an editor template  being used in a grid column. The editor template is supposed to show the phases of treatment of a patient in an application which we are building.

The first time when the page loads, the grid shows correctly with patent id in the first column and the editor template showing 'pre - treatment' in the second column (as a dropdown list).

However, when we try to add a new row to the grid with a button click, in addition to a new row being added, it is observed that in the initial row as described above, the editor template changes from dropdown list to textbox, with the value (pre - treatment) being lost.

We are attaching a code sample for your kind reference.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 12 Mar 2013, 08:45 AM
Hi Joonu,

You should take a different approach in order to create a widget as part of the display template of the cell. More appropriate place to instantiate the widget will be to use the Grid's dataBound event. I have attached a modified version of the sample you have provided which illustrates this. Note the use of cancel event which is introduced  in the Q1 2013 BETA release.

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