This question is locked. New answers and comments are not allowed.
Hello
I want to copy data of one row into another when clicked on custom command button. However, i am able to get new blank row to open up when clicked on custom button but how can i load the data of the row having custom button into newly opened row. Any help will be appreciated.
I want to copy data of one row into another when clicked on custom command button. However, i am able to get new blank row to open up when clicked on custom button but how can i load the data of the row having custom button into newly opened row. Any help will be appreciated.
4 Answers, 1 is accepted
0
Hi Nancy,
Basically this feature is not supported - I would suggest upgrade to KendoUI where it can be achieved using simple JavaScript code.
Kind Regards,
Vladimir Iliev
the Telerik team
Basically this feature is not supported - I would suggest upgrade to KendoUI where it can be achieved using simple JavaScript code.
Kind Regards,
Vladimir Iliev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Nancy
Top achievements
Rank 1
answered on 27 Dec 2012, 08:31 AM
Hello Vladimir Iliev
Thnx for the reply. But isn't there any other way this functionality can be achieved? Since i am using Telerik Grid there is no point using KendoUI. Do let me know if there is any alternative way this can be accomplished.
Thnx for the reply. But isn't there any other way this functionality can be achieved? Since i am using Telerik Grid there is no point using KendoUI. Do let me know if there is any alternative way this can be accomplished.
0
Hi Nancy,
Kind Regards,
Vladimir Iliev
the Telerik team
Basically you can extend the new model with the currently selected grid row model, make the ID equal to the default value and use the insertRow method to create the new record:
<button id="copy" onclick="CopyRow()"> copy </button><script type="text/javascript"> function CopyRow() { //Replace 'Grid' with your grid name var grid = $('#Grid').data("tGrid"); var selectedRow = grid.$tbody.find(".t-state-selected"); if (selectedRow.length) { var item = grid.dataItem(selectedRow); var newModel = {}; $.extend(newModel, item); //Replace ProductID with your model ID newModel.ProductID = 0; //make the ID the default value grid.insertRow(newModel); } }</script>Kind Regards,
Vladimir Iliev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Nancy
Top achievements
Rank 1
answered on 27 Dec 2012, 10:17 AM
Do ID need to set to 0 value?