I'm trying to move rows around. I have goRowMoving = True.
I can't find any method to do the move, so am using drag/drop.
Manual drag mode.
However, when dropping the row, I get exception 'Cannot insert or delete rows from grid'
Also, how do I get the 'Drop' row number?
// This drops it in Row 0
procedure TForm1.grdSourceListDragDrop(Sender, Source: TObject; X,
Y: Integer);
begin
grdSourceList. Rows[FintDragRow].Move(FintDragRow,0);
end;
procedure TForm1.grdSourceListMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
grdSourceList.BeginDrag(False, 4);
end;
// Get the row I'm moving
procedure TForm1.grdSourceListStartDrag(Sender: TObject;
var DragObject: TDragObject);
begin
FintDragRow := grdSourceList.Row;
end;
Ta.
I can't find any method to do the move, so am using drag/drop.
Manual drag mode.
However, when dropping the row, I get exception 'Cannot insert or delete rows from grid'
Also, how do I get the 'Drop' row number?
// This drops it in Row 0
procedure TForm1.grdSourceListDragDrop(Sender, Source: TObject; X,
Y: Integer);
begin
grdSourceList. Rows[FintDragRow].Move(FintDragRow,0);
end;
procedure TForm1.grdSourceListMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
grdSourceList.BeginDrag(False, 4);
end;
// Get the row I'm moving
procedure TForm1.grdSourceListStartDrag(Sender: TObject;
var DragObject: TDragObject);
begin
FintDragRow := grdSourceList.Row;
end;
Ta.