Mouse API

TreeGrid documentation

chg 6.0 API event bool

OnClick

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called after click to cell [row, col]. row and col are never null.
x, y is click position inside the cell. event is standard JavaScript MouseEvent to get for example information about Ctrl/Alt/Shift keys or other information about click.
Return true to suppress default OnClick action
API event bool

OnDblClick

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called after double click to grid. row or col can be null for double click outside the cells.
x, y is click position inside the cell. event is standard JavaScript MouseEvent.
Return true to suppress default OnDblClick action
API event bool

OnRightClick

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called after right click to grid. row or col can be null for double click outside the cells.
x, y is click position inside the cell. event is standard JavaScript MouseEvent.
Return true to suppress default OnRightClick action
new 12.1 API event bool

OnLongClick

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called on click with time between mouse/touch down and up longer than LongClick (default 500ms).
new 12.1 API event bool

OnRightLongClick

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called on right click with time between mouse/touch down and up longer than LongClick (default 500ms).
new 12.1 <Cfg> int

LongClick

[500]
Time between mouse / touch down and up to be the click taken as long click.
For long click there are called special long click events and next standard click events.
new 12.1 <Cfg> bool

MacContextMenu

[0/1]
When the context menu is displayed on Mac computers on right click.
0 - Mac way, displayed on mouse down. It can collide with dragging by right mouse button.
1 - Windows way, displayed on mouse up. It always suppresses default browser context menu. Useful for dragging by right mouse button.
By default it is 1 on grids with Gantt chart and 0 in other grids.
API event bool

OnMouseDown

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called after mouse down in grid. row or col can be null for double click outside the cells.
x, y is click position inside the cell. event is standard JavaScript MouseEvent.
Return true to suppress default OnRightClick action
API event bool

OnMouseUp

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called after mouse up in grid. row or col can be null for double click outside the cells.
x, y is click position inside the cell. event is standard JavaScript MouseEvent.
Return true to suppress default OnMouseUp action
API event bool

OnMouseMove

(TGrid grid, TRow row, string col, int x, int y, Event event)
Called whenever mouse moves above grid. row or col can be null for double click outside the cells.
Use only very short code here to not slow down the grid.
x, y is click position inside the cell. event is standard JavaScript MouseEvent.
Return true to suppress default OnMouseMove action
API event void

OnMouseOver

(TGrid grid, TRow row, string col, TRow orow, string ocol, Event event)
Called after whenever mouse enters to another cell or outside any cell or row.
row or col is new cell, the orow, ocol is old cell. All parameters except grid can be null.
event is standard JavaScript MouseEvent.
new 12.1 API variable int

Touched

It is set inside mouse events when the event is processing touch event on touch screen.
It is set to count of actually held fingers on touch screen.
Touch events do not work in MS IE in any version.
Touch events work in all other browsers on tablets and mobiles and in Chrome and Safari on desktop by default.
Touch events in MS Edge on desktop you have to permit in about:flags, option Touch - Touch events - Enable touch events.
Touch events in Firefox on desktop you have to permit in about:config, option dom.w3c_touch_events.enabled = 1.
global func. TGrid

Grids.Active

Pointer to active grid under the mouse cursor. It processes mouse wheel events.
API variable TRow

ARow

read only
Actual row under mouse cursor or null
API variable string

ACol

read only
Actual column under mouse cursor