Hi Boki,
I'm just trying to manage some groups and subgroups, but got difficulties;
I use a NextGrid with an TnxTreeColumn and some rows and childrows.
I'd like to move with DragDrop mouse, the selected row to different position.
e.g. Row 'Sub child 3' to be slave to 'master'.
How to determinate the Destination ROW in DragDrop event?
What value need to have argument Index to make source row child and put it as last child row of child list?
nextgrid61.Row[nextgrid61.SelectedRow].MoveTo(????,0);
for example TTreeview has function GetNodeAt(X, Y: Integer). is any similar function in Nextgrid?
Here is my code
procedure TForm1.Button1Click(Sender: TObject); var i: integer; begin nextgrid61.AddCells(['MASTER','0','1'],[0,1,2]); for i := 1 to 3 do with nextgrid61.AddChildRow(0,1) do cells.Item[0].AsString:='Child '+inttostr(i); for i := 1 to 3 do with nextgrid61.AddChildRow(2,1) do cells.Item[0].AsString:='Sub-Child '+inttostr(i); for i := 1 to 3 do with nextgrid61.AddChildRow(6,1) do cells.Item[0].AsString:='Sub-baby '+inttostr(i); end; procedure TForm1.NextGrid61DragDrop(Sender, Source: TObject; X, Y: Integer); begin nextgrid61.Row[nextgrid61.SelectedRow].MoveTo('????',0); end; procedure TForm1.NextGrid61MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbLeft) and not (ssDouble in Shift) then nextgrid61.BeginDrag(FALSE, 5); end;
Best Regards
Bicks