Manzana
Manzana

Reputation: 325

How to select rows on right click in Ag-grid

This might be a rather simple question to answer.

I'm using Ag-Grid with React (ag-grid community + enterprise)

I noticed that if I right click on a row and I select an action on the context menu that appears, it will apply the action to the row that was actually selected and not the one I right-clicked on. How can I select a row with a right-click?

I will add details of my code on demand if needed. Thanks in advance.

Upvotes: 3

Views: 4508

Answers (1)

Shankul
Shankul

Reputation: 76

You can hook in cellContextMenu grid event and select the corresponding row as the first thing before proceeding to the rest of the logic. Something like this:

<AgGridReact onCellContextMenu={event => event.node.setSelected()}>

Upvotes: 4

Related Questions