Hugo Ribeiro
Hugo Ribeiro

Reputation: 1

MUI data-grid-premium customize drop rules

I am using MUI data-grid-premium and I currently have a drag&drop/rowReordering data-grid as documented here https://mui.com/x/react-data-grid/row-ordering/. Passing that prop allows me to have draggable and droppable rows on that data-grid and that is exactly what I want.

On top of that I just need to implement the following rule: I can drag and drop "freely" in the data-grid but I can't drop a row on the first position/on top of the first row that I have on the data-grid.

I have been trying to do that with the events/callbacks described here https://mui.com/x/react-data-grid/row-ordering/ (rowDragOver, rowDragEnd, onRowOrderChange, ...), but I'm not being able to find an easy way to do this..

Is there a way to customize the data-grid with that custom rule?

Thanks in advance, best regards, Hugo.

Upvotes: 0

Views: 30

Answers (0)

Related Questions