View Issue Details

IDProjectCategoryView StatusLast Update
0034390LazarusLCLpublic2018-12-02 02:17
ReporterNewGuestAssigned ToJesus Reyes 
Status resolvedResolutionfixed 
PlatformALLOSWindows 8.1 x64 SL RussianOS Version
Product VersionProduct Build 
Target Version2.0Fixed in Version2.1 (SVN) 
Summary0034390: MouseMoveEvent in DBGrid
DescriptionIn DBGrid, if you click and click on a previously selected row, the OnMouseMove event will not occur.
TagsNo tags attached.
Fixed in Revision59713
Attached Files



2018-11-28 11:06

reporter   ~0112243

Last edited: 2018-11-28 11:07

View 2 revisions

Tell me when the fix is planned?


Jesus Reyes

2018-11-29 06:16

developer   ~0112253

That depends on if we agree there is a bug, from your description I'm not sure. Is the dbgrid attached to dataset? is the dataset active?, do you re-click on the same column?, is the option rowselect active?, ....

There are many things you don't describe and if there is a bug, I don't want to guess what the bug is.

Attach a sample project and describe better what you think is the bug.


2018-11-29 15:28

reporter   ~0112254

Last edited: 2018-11-29 15:33

View 2 revisions

The idea is to create a drag and drop effect using the drap & prop method. The only problem is that if you click the active cell, the drag event does not occur.
I can give an example of a project in the DataExpress program (it is developed in Lasarus. Author: Pavel Dubokin). This is the constructor inside which the DBGrid properties and methods are ported.
The program itself is located here:
An example of the project was given here:
The same question was asked to the author of DataExpress on the program's forum:

Example code (Pascal Script):

var MBPressed:boolean;

procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
if Self.State <> dsEdit then Self.Edit;
if MBPressed then
Self.Forms['Форма 4'].Grid.Cursor:=crMultiDrag;
   if msg <> 'move' then

procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  msg:='mouse button down';
  debug('------- start --------')

procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  if MBPressed then
  msg:='mouse button up';
  debug('------- end --------'+0000013#10)

procedure Form_Create;
  Self.Forms['Форма 4'].Grid.OnMouseMove:=@MouseMove;
  Self.Forms['Форма 4'].Grid.OnMouseDown:=@MouseDown;
  Self.Forms['Форма 4'].Grid.OnMouseUp:=@MouseUp;


2018-11-29 15:46

reporter   ~0112255

Additionally made a screencast:

Jesus Reyes

2018-12-02 02:17

developer   ~0112310

Please test.

Issue History

Date Modified Username Field Change
2018-10-05 09:25 NewGuest New Issue
2018-10-05 12:59 Marco van de Voort Project FPC => Lazarus
2018-10-07 07:25 Jesus Reyes Assigned To => Jesus Reyes
2018-10-07 07:25 Jesus Reyes Status new => assigned
2018-11-28 11:06 NewGuest Note Added: 0112243
2018-11-28 11:07 NewGuest Note Edited: 0112243 View Revisions
2018-11-29 06:16 Jesus Reyes Note Added: 0112253
2018-11-29 15:28 NewGuest Note Added: 0112254
2018-11-29 15:33 NewGuest Note Edited: 0112254 View Revisions
2018-11-29 15:46 NewGuest Note Added: 0112255
2018-12-02 02:17 Jesus Reyes Fixed in Revision => 59713
2018-12-02 02:17 Jesus Reyes LazTarget => 2.0
2018-12-02 02:17 Jesus Reyes Note Added: 0112310
2018-12-02 02:17 Jesus Reyes Status assigned => resolved
2018-12-02 02:17 Jesus Reyes Fixed in Version => 2.1 (SVN)
2018-12-02 02:17 Jesus Reyes Resolution open => fixed
2018-12-02 02:17 Jesus Reyes Target Version => 2.0