Subject Re: [IBO] Drag&Drop and IB_Grid
Author Markus Ostenried
At 01:22 Wednesday, 05.02.2003 +0100, Guido wrote:
>I want to use Drag&Drop between a IB_Grid and a ListView, but I have
>some problems with the IB_Grid. When I set DragMode to dmAutomatic I
>cannot select a row in the grid clicking with mouse. But when I set
>DragMode to dmManual Drag&Drop the operation doesn't work.
>
>I use IBO 4.2Ib


Hi,

I have set DragMode to dmManual and in my grid's OnMouseMove
event I call Grid.BeginDrag like this:

procedure TM_TermToDo.Grid_TermToDoMouseMove( Sender: TObject; Shift:
TShiftState;
X, Y: Integer );
var
Cell: TGridCoord;
begin
if (Sender = Grid_TermToDo) then begin
Cell := Grid_TermToDo.MouseCoord( X, Y );
if (Cell.Y > 0) and (ssLeft in Shift) and Qry_TermToDo.Active and
(Qry_TermToDo.FieldByName('TT_ANZAHLTODO').AsInteger > 0) and
not Qry_TermToDo.FieldByName('TT_ID_TERMTODO').IsNull then
begin
Grid_TermToDo.BeginDrag( false ); // <- see help for parameters !
end;
end;
end;

and then in the Grid's OnStartDrag I assign my custom TDragObject
descendant that holds some information about what's being dragged.

HTH,
Markus