7 Answers, 1 is accepted
0
Paul
Top achievements
Rank 1
answered on 30 Mar 2012, 03:00 PM
Has anyone implemented this? I am looking for the same thing.
Thank you in advance.
Thank you in advance.
0
Marko
Top achievements
Rank 1
answered on 02 Apr 2012, 08:59 AM
I am looking for the same thing too.
-Marko
-Marko
0
Paul
Top achievements
Rank 1
answered on 02 Apr 2012, 01:42 PM
I figured it out. With multiselect you can't do drag and drop, so you'll have to use a click event to copy the selected rows from one grid to another. Here's the javascript code:
I hope this helps.
$('#btnAddMulti').click(function () { var sourcegrid = $('#searchgrid').data('kendoGrid'); //SOURCE GRID var destinationgrid = $('#selectedgrid').data('kendoGrid'); // DESTINATION GRID sourcegrid.select().each(function () { var dataItem = sourcegrid.dataItem($(this)); destinationgrid.dataSource.add(dataItem); // DESTINATION DATASOURCE }); destinationgrid.refresh(); // MUST REFRESH THE DESTINATION GRID alert('refreshed'); });
I hope this helps.
0
Marko
Top achievements
Rank 1
answered on 03 Apr 2012, 07:34 AM
Hi,
Thanks Paul for example, it works.
Is it possible to avoid duplicates (liike. same product name) in destination grid? So, that items can be copied only once. In asp.net I'm using Insert event to check if item already exists.
-Marko
Thanks Paul for example, it works.
Is it possible to avoid duplicates (liike. same product name) in destination grid? So, that items can be copied only once. In asp.net I'm using Insert event to check if item already exists.
-Marko
0
Paul
Top achievements
Rank 1
answered on 03 Apr 2012, 02:44 PM
Marko, I just implemented this as well, it's pretty easy:
$('#btnAddMulti').click(function () { var sourcegrid = $('#searchgrid').data('kendoGrid'); //SOURCE GRID var destinationgrid = $('#selectedgrid').data('kendoGrid'); // DESTINATION GRID sourcegrid.select().each(function () { var dataItem = sourcegrid.dataItem($(this));var column = dataItem.ProductId; // whatever the name of the unique id for your data source if (destinationgrid.dataSource.get(column) == null) destinationgrid.dataSource.add(dataItem); // DESTINATION DATASOURCE//*******************
// Check to make sure it's not in thereelse alert('already exists');//*******************
}); destinationgrid.refresh(); // MUST REFRESH THE DESTINATION GRID alert('refreshed'); }); Here's my data source to see the "ProductId": var dataSource = new kendo.data.DataSource({ data: data.datalist, schema: { model: { id: "ProductId", fields: { ProductId: { type: 'int', nullable: false }, ProductName: { type: 'string', editable: false, nullable: true } } } } });
0
Ricardo
Top achievements
Rank 1
answered on 03 Apr 2012, 03:10 PM
is not my post but thanks, I served a lot of your example
0
jonathan
Top achievements
Rank 1
answered on 30 Oct 2012, 02:30 PM
Hey guys,
I have implemented your above example, but am editing the destination grid by cell. When you edit a cell in the destination grid, it updates the source as well. Is there a way around this?
I have implemented your above example, but am editing the destination grid by cell. When you edit a cell in the destination grid, it updates the source as well. Is there a way around this?