drag and drop to top row

How do you drag and drop a row so it is moved to the top/first row? I thought dropping on the header should do it but it isn’t working on these website samples in Chrome or IE 10.

In the sample: dhtmlx.com/docs/products/dht … vents.html
When I drop on the header, nothing happens.

In the sample (for dragging between grids):
dhtmlx.com/docs/products/dht … _grid.html
When I drop on the header, the row is added as the last row.

Thanks in advance for your help.

Please, try to use the setDragBehavior() method:
Grid.setDragBehavior(“complex”)

Thanks, that worked! I am able to drag a row now to directly above the first row (but below the header) and it will move that row to the top as expected. What is interesting is that if I drag too high and drop it on the header, the row ends up getting moved to the bottom. I got around this by adding an onDrag event and returned false if the target id is undefined. There’s probably better ways to do this, but in case anyone else has a similar issue, this is my code:

mygrid.enableDragAndDrop(true);
mygrid.setDragBehavior(“complex”);
mygrid.attachEvent(“onDrag”,drag_f);

function drag_f(sId,tId,sObj,tObj,sInd,tInd) {
if (typeof tId === ‘undefined’) return false;
return true;
}