issue with enableMercyDrag in dhtmlxgrid / dhtmlxtreegrid


I am using licensed version of dhtmlx grid control in my application. I must say the usability experience has been very good. I found a bug in the drag drop between two grids.

I have got 2 different poup-up windows in my application (both containing dhtmlx grid control), the user should be able to drag and drop rows from one grid to the other. But as per our requirement some rows should not be added to the other grid (I am stopping this with my server side code, not js).

To load the grids we send an xml string from the server side c# code to the javascript prototype, and the grid is loaded from this xml. So if there are few particular type of rows in the grid from which rows are dragged, that should not be added to the other grid I stop it from the server side by not adding it to the xml. But here the problem is as enableMercyDrag is 1 is just copies the row to the other grid, even though I do not want it, and even though it not part of the data source (the xml) for the grid.

Following are few drag and drop related settings.



I have disabled the native drag drop feature as we have our custom logic in there to add custom data to the row and the cells

initializeDragDropListeners: function() {

var emptyFunc = function() {

return false;


this._grid.attachEvent(“onDrag”, emptyFunc);

this._grid.attachEvent(“onDragIn”, emptyFunc);

this._grid.attachEvent(“onDrop”, emptyFunc);


I want to keep enableMercyDrag = 1 , but want to restrict the copying of rows from one grid to the other. How can I do this ?

If you don’t want some row’s to be copied to another grid you can restrict this using “onDrag” event:

if (sourceId==necessaryRowId) return false;
else return true;

mygrid - object of a target grid. … rid_mandnd