Jump to content


bicks

Member Since 17 Apr 2020
Offline Last Active Feb 15 2022 06:38 PM
-----

Topics I've Started

How to move Childrow with Drag/drop in NextGrid?

12 February 2022 - 01:42 PM

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


How to find Top,Left properties of a Cell in NxGrid?

23 March 2021 - 08:24 PM

Hello Boki,

 

I need to show a popup menu when select a specific cell in TnxGrid. So my question: How to get the postion(Left,Top)  of the cell in the grid to set the position of the popup?

 

Best Regards