Pedro Silveira
Pedro Silveira

Reputation: 342

How to select row when drag start on Ag-grid?

My grid has only 1 column.

Currently, If I enable row dragging, I'm not able to select rows, unless I bind a key to set

supressRowDrag=true

Should be possible and even simple, since the row node is already being selected somehow. (Border gets blue after clicking.)

I want to simultaneously select and start the drag when the row is clicked.

Thanks in advance

Upvotes: 1

Views: 1009

Answers (1)

NearHuscarl
NearHuscarl

Reputation: 81833

Add this props to AgGridReact if you want the rows get selected when the drag begins.

onRowDragEnter={(e) => e.node.setSelected(true)}

Live Demo

Edit 63963503/how-to-select-row-when-drag-start-on-ag-grid-react

Upvotes: 1

Related Questions