diff --git a/packages/core/src/internal/data-grid-dnd/data-grid-dnd.tsx b/packages/core/src/internal/data-grid-dnd/data-grid-dnd.tsx index f91c16da6..5bf4a8cf4 100644 --- a/packages/core/src/internal/data-grid-dnd/data-grid-dnd.tsx +++ b/packages/core/src/internal/data-grid-dnd/data-grid-dnd.tsx @@ -252,7 +252,7 @@ const DataGridDnd: React.FunctionComponent = p => { } clearAll(); - if (dragCol !== undefined && dropCol !== undefined) { + if (dragCol !== undefined && dropCol !== undefined && !(onColumnProposeMove?.(dragCol, dropCol) === false)) { onColumnMoved?.(dragCol, dropCol); } if (dragRow !== undefined && dropRow !== undefined) { @@ -277,6 +277,7 @@ const DataGridDnd: React.FunctionComponent = p => { onColumnMoved, onRowMoved, clearAll, + onColumnProposeMove, ] );