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

How to add a new row in grid load

3 Answers 664 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sameer
Top achievements
Rank 1
Sameer asked on 16 Jul 2012, 12:48 PM
I am using a grid which is loaded from database and also toolbar for creating a new record.
But instead of using the tool bar i want a new record to be opened by default at the time of loading the grid.(i.e addrow() method without clicking any button)
how is it possible? 
I have attached the image which i needed on grid load.
pls suggest....  

sam.

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 18 Jul 2012, 06:15 AM
Hi Sam,

To achieve this you could hook up to the grid's dataBound event and then use the addRow() method. Please note that you need to setTimeOut to ensure the grid is rendered. For example:
$("#grid").kendoGrid({
  //....
  dataBound: function(){
     setTimeout(function() {
        var grid = $("#grid").data("kendoGrid");
        grid.addRow(); 
     });
  }
});
   
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sameer
Top achievements
Rank 1
answered on 18 Jul 2012, 10:58 AM
Hi Iliana Nikolova,

Thanks for your reply.

It worked for me for creating a new row at the loading of grid but, as a new row is in edit mode i am not able to update any of the available rows.

regards,
sam.


0
Iliana Dyankova
Telerik team
answered on 19 Jul 2012, 04:36 PM
Hello Sameer,

I am not sure if I understand you correctly - at a time only one row of the grid can be in edit mode. After you enter data in the new-added row you are able to update the other rows. I am attaching my test project, could you please check it and let me know if I missed something? Thank you in advance.

Regards,
Iliana Nikolova
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
Sameer
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Sameer
Top achievements
Rank 1
Share this question
or