In your code there ate next method calls
CopySelectionToClipboard
PasteSelectionFromClipboard
But there are not such methods in grid, the correct names are
copyBlockToClipboard
pasteBlockFromClipboard
all other seems correct.
I have changed the code to
function onKeyPressed(code,ctrl,shift)
{
if(ctrl&&code==67)
{
mygrid.copyBlockToClipboard();
}
if(ctrl&&code==86)
{
mygrid.pasteBlockFromClipboard();
}
return true;
}
Now i am able to copy only single cell not a row complete , can you plz guide me how to achieve this
copyBlockToClipboard operation was designed to copy data from selected area, not the whole row ( if block selection covers whole row - whole row will be copied to clipboard )
The grid supports rowToClipboard methods which will copy whole row to clipboard, but you need to specify ID of row which need to be copied ( so it can’t be used with block selection )
The only way, to achieve desired behavior - manual serialization
var data = [];
for (var i=0; i<mygrid.getRowsNum(); i++)
if (mygrid.getLevel(mygrid.getRowId(i))
data.push(mygrid._serializeRowToCVS(null,i).replace(/<[^>]*>/g,""));
mygrid.toClipBoard(data.join("\n"));