Saving column headers in clipboard

I use this code to save the grid selection area to the clipboard:
function onKeyPressed(code,ctrl,shift){
if (!_mygrid._selectionArea)
return alert(“You need to select a block area in grid first”);
return true;

How can I get it to save the column headers to the clipboard also? _mygrid.enableCSVHeader(true); doesn’t do it.


enableCSVHeader controls header during CSV serialization, but copyBlockToClipboard copies only selected data, so it doesn’t affected by enableCSVHeader option.

You can access column labels directly ( through getColumnLabel ) and use

var val = grid.fromClipboard(); val = some + val grid.toClipboard(val);