# Force click on table row when right clicking it

**URL:** <https://forum.inductiveautomation.com/t/force-click-on-table-row-when-right-clicking-it/98384>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 8, 2024, 10:10am UTC](https://forum.inductiveautomation.com/t/force-click-on-table-row-when-right-clicking-it/98384 "2024-11-08T10:10:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmadariaga](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmadariaga/32/63201_2.png) [@mmadariaga](https://forum.inductiveautomation.com/u/mmadariaga)\
**Post date:** [November 8, 2024, 10:10am UTC](https://forum.inductiveautomation.com/t/force-click-on-table-row-when-right-clicking-it/98384/1 "2024-11-08T10:10:28Z")

</div>

Hello, I have a context menu to move and block rows of a table. I update the selected row using the _selected_ property. The user has to click on the row and then right click and open the context menu for it to work as expected. Is there a way to automatically click when the user right clicks so the desired row is selected?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c9333c450356209333d55628c65f0e900ff5b8e.png)

---

<div class="post-metadata">

**Author:** ![ryan.perretta](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.perretta/32/75110_2.png) [@ryan.perretta](https://forum.inductiveautomation.com/u/ryan.perretta)\
**Post date:** [November 8, 2024, 2:12pm UTC](https://forum.inductiveautomation.com/t/force-click-on-table-row-when-right-clicking-it/98384/2 "2024-11-08T14:12:06Z")

</div>

I tried to get something like this to work on my own project some time ago, and I was not able to get it to function with a right-click.

What I ended up doing was using a Ctrl+Click by setting a KeyEvent listener on the Session Events that sent a message on KeyDown setting a custom property `ctrlDown` to True and on KeyUp setting it to False. Then in the table's `rowOnClick` event I checked if this property was true and used that to trigger the alternate action that would have been done via a right-click.

Worked pretty smoothly for me, but I'm not as savvy as some of the folks on here so maybe its not the best solution. 😆

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [November 8, 2024, 2:55pm UTC](https://forum.inductiveautomation.com/t/force-click-on-table-row-when-right-clicking-it/98384/3 "2024-11-08T14:55:35Z")

</div>

In order to achieve something similar in the past, I have had each column be a view render and used labels for non visual needs. The row index is then passed into the view automatically as a parameter.  
[Perspective - Table | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table#properties)

_See the docs for all available params passed in implicitly._

Then when a right click is made you can fire off a `system.perspective.sendMessage` and select the row when a messageHandler is invoked on the table side.

This is a bit of a weird work around but, it has done us well.  
Something to note, if your table is going to have a ton of records (10K+) view rendering time for the columns can be a bit degraded, so base this on your use case.
