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

2 posts, 0 answers
  1. Joonu
    Joonu avatar
    6 posts
    Member since:
    Sep 2012

    Posted 08 Mar 2013 Link to this post

    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.

  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 12 Mar 2013 Link to this post

    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!
Back to Top