Inserting multiple records with one click in Telerik mvc grid
I am working on a Telerik MVC grid. My requirement is to allow a user to insert multiple records into the grid. This should开发者_运维知识库 be done on the client side.
After entering several records in the grid, the user will click a button so that all the records are inserted into the database.
Is this possible with Telerik MVC grid?
Thanks in advance.
Here is a guide for doing a batch update from Telerik themselves: http://www.telerik.com/help/aspnet-ajax/grdperformingbatchupdates.html
Here is a demo using automatic operations to allow multi-row editing: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
Here is another ticket which links to a demo from Telerik doing this type of thing: http://www.telerik.com/community/forums/aspnet-ajax/grid/339723-batch-insert.aspx
Bottom line: it can be done, but it isn't super easy and will require quite a bit of custom code. More than I am able to share here, but the above links (especially the last one) should provide you the resources you need.
Not supported out-of-the-box from the Telerik MVC grid extensions AFAIK, but it should be possible by making jQuery ajax or web service calls which add items in the source and bind the grid. And I recently heard that they crafted batch client edits/updates for the Q1 2011 release, due in mid March.
The latest release of Telerik MVC Grid supports what's called batch editing directly. Here is the documentation on how to use the new feature.
精彩评论