Hi xarlap,
There is no API to support this. But you can change the DataGrid implementation to achieve this requirement. Open DataGrid.egl, make changes to below functions:
1. Modify enableDragging() to disable dragging of column 1 and 2
private function enableDragging() columnCount int = columns.getSize(); tds Widget[] = grid.getElementsByTagName("span"); count int = tds.getSize(); for(n int from 3 to count) //Only enable d&d from column 3 if(tds[n].id like (grid.id + "-header-%")) header Widget = tds[n]; header.onStartDrag = startDrag; header.onDrag = dragColumn; header.onDropOnTarget = endDrag; end end end
2. Modify getTargetColumn() to disable drop to column 1 & 2
private function getTargetColumn(x int in) returns(int) columnCount int = columns.getSize(); dx int = ui.x; for(column int from 1 to columnCount) w int = 2 * cellPadding + columns[column].width; if(x > dx && x < dx + w) if(column <=2 ) column = 3; end return(column); end dx += w; end end
Notice that, these changes are like hacking which is not included in the product.
HuangJiYong