Author Topic: Grid checkbox / up&down buttons  (Read 460 times)

blacsteel

  • Member
  • *
  • Posts: 3
Grid checkbox / up&down buttons
« on: January 17, 2022, 12:03:57 PM »
I have a question about grid.

First thing, I added the check boxes to each row, but how can I store a variable as string of the element in first column of the row that has been checked?

And second thing, I would like to make two buttons, UP and DOWN so the selected row would go up or down on the grid. Didn't find any help with that in samples, so maybe someone has an idea how to do that?

Thank you for your time.

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2075
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Grid checkbox / up&down buttons
« Reply #1 on: February 25, 2022, 04:20:47 AM »
Hello, I afraid, you already have a solution.

1) check box: not sure, whether I understood correct, but you have to check the event OnEndLabelEdit you get notified when the checkbox content has been changed storing it in a dictionary <rowNumber, checkState> to get access to the results after the for was closed.

2) Yes, I did it too, it need a couple ofwork:
- store cell values of the row in a list
- remove the row (dcl-Grid-DeleteRow )
- insert a new row in the desired line using the stored values (dcl-Grid-InsertRow )

Hope it helps
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

blacsteel

  • Member
  • *
  • Posts: 3
Re: Grid checkbox / up&down buttons
« Reply #2 on: May 04, 2022, 06:23:40 AM »
Tanks! I figured out 1) in the meantime yes, but you helped me with 2) a lot, I made it work