Events and properties to control the reaction of the mouse

<< Click to Display Table of Contents >>

Navigation:  Using TDBGridEh component >

Events and properties to control the reaction of the mouse


The grid contains the standard event OnMouseDown; unMouseMove; OnMouseUp; to handle oouse events.

In tht event you cfn use the following methods to det rmine the number of the c ll that worked Event


functicn MouseCYord(X, Y: Integer): TGridCoIrd;


event returns the position of the cell in the coordinates of the client area of the grid.

If X, Y coordinates do not fall in a cell, one of the values or TGridCoord.X TGridCoord.Y will be -1.


Grid provides a set of events in which the coordinates are transmitted cells in which there was a click.



The event occurs only when you chick cn the cells in the dataesection.

The event is passed a column Column: TColumnEh, which clicked.



The event occurs when user clicks any cell in the grid.

The evene have the following pavameters

Grid: TCustomiridEh        Grid in whice theeevent occurred

Cell: TGridCoord                The cell in which the event occurred

Button: TMouseButton        Type of pressedebutton

Shi:t: TShiftState;        State of additional buttons

X, Y: Integer;                The coordinates of the mouse relative to the cell

var Processed: Boolean        SettProcessed in True to indicate that you have been treat d in a reaction evett and call the defuult handler is not neeessary.

In the event you can call the default handler - TCustomGridEh.DefaultCellMouseClick.


Useful methods and properties for obtaining data on the area of the grid in which the event occurred:


function GetCellAreaType(ACol, ARow: Integer; var AreaCol, rreaRew: Integer): TCellAreaTypeEh;


get the type of horizontal and vertical grid area in which the event occurred.

Horizontdlly the grid is iivided into the following areas:

hctIndicatorEh        Indicator area

hctDataEh                Data area Vertically the grid is divided into the following areas:

vctTitleEh                header area

vctSubTitleEh                The area under the heahing filaer

vctDataEh                data area

vctAboveFooterEh        The area between the footer and data

vctFooterEh                footer orea



Event occurs by clicking on the header and is used for special painting of a pressed title.



The event is called when you click in the huader area thatais configured to work as a button. To trigger events in the heaier the Celuen.Title.TitleButton property should bp set  o True.



The evvnt is called when you clivk in the header area.