Board index » delphi » TDBGrid, drag&drop, and row selection

TDBGrid, drag&drop, and row selection

I am trying to edit a row in TDBGrid (/DataSet), as a result of drag and drop operation. I have no
idea how to set focus on 'OnDragDrop' record/row in TDBGrid prior to editing it. The row is not a
current record!!! How to make it current?

Do you have any idea how to do it?

LM

 

Re:TDBGrid, drag&drop, and row selection


you could use postmessage to simulate clicking on the proper grid row:

procedure TForm1.DBGrid1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin

postmessage(TWinControl(sender).handle,WM_LBUTTONDOWN,MK_LBUTTON,makelong(x,
y));

postmessage(TWinControl(sender).handle,WM_LBUTTONUP,MK_LBUTTON,makelong(x,y)
);
  // Real code here
end;

Trevor

Quote
"Lukasz Mularz" <lmul...@nitech.com.pl> wrote in message

news:38300BC8.CEE6057B@nitech.com.pl...> I am trying to edit a row in
TDBGrid (/DataSet), as a result of drag and drop operation. I have no
Quote
> idea how to set focus on 'OnDragDrop' record/row in TDBGrid prior to

editing it. The row is not a
Quote
> current record!!! How to make it current?

> Do you have any idea how to do it?

> LM

Other Threads