Setting Selected Row and Column on Table Right Click

Here’s a different way to do the same thing:

[code]from java.awt import MouseInfo, Point
table = event.source
#get the mouse pointer location on the computer monitor
p = MouseInfo.getPointerInfo().getLocation()
#get the mouse pointer location relative to the Ignition application
mousex = p.x - table.getTable().getLocationOnScreen().x
mousey = p.y - table.getTable().getLocationOnScreen().y
mousep = Point(mousex,mousey)

#get the cellRow and cellCol and set them in the table
cellCol = table.getTable().columnAtPoint(mousep)
cellRow = table.getTable().rowAtPoint(mousep)
table.getTable().addColumnSelectionInterval(cellCol, cellCol)
table.getTable().addRowSelectionInterval(cellRow,cellRow)[/code]This goes in the mouseClicked event script on the table.