Recent

Author Topic: DBVirtualGrid - processing multi selections  (Read 1084 times)

Arskin_Fertrubble

  • New Member
  • *
  • Posts: 15
DBVirtualGrid - processing multi selections
« on: September 26, 2023, 07:49:08 am »
Long time pascal/ Delphi person here. Finally got time to spend with Lazarus to port an old Delphi project to Lazarus/ linux.

I settled on  DBVirtualgrid for the project. It's  been relatively straightforward. However I'm stuck on trying to processes multi row selections in the grid. I don't see a selectedrows property or similar, although I do see a SelectedRecordsCount.

Can someone enlighten me how I can iterate through the selected rows to latch onto the respective database record?

Thanks.


wp

  • Hero Member
  • *****
  • Posts: 12459
Re: DBVirtualGrid - processing multi selections
« Reply #1 on: September 26, 2023, 11:08:54 am »
Cannot find a "DBVirtualGrid"... Or do you mean the "VirtualDBGrid" which exists in https://github.com/blikblum/luipack/tree/master/vtvextras/virtualdbgrid? But it does have a SelectedRecord[Index: Integer]: TRecordData property, as well as a SelectedCount (inherited from TVirtualStringTree), but no "SelectedRecordsCount".

Arskin_Fertrubble

  • New Member
  • *
  • Posts: 15
Re: DBVirtualGrid - processing multi selections
« Reply #2 on: September 27, 2023, 02:11:08 am »
Yeah, sorry, VirtualDBGrid 

I've spent time with the properties you mention but cannot work out how to identify and loop through the selected rows.

Arskin_Fertrubble

  • New Member
  • *
  • Posts: 15
Re: DBVirtualGrid - processing multi selections
« Reply #3 on: September 27, 2023, 02:18:26 am »
I've reverted to the default Lazarus DBGrid component. It makes what I want to do more intuitive and easier.

Cheers

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: DBVirtualGrid - processing multi selections
« Reply #4 on: September 27, 2023, 02:49:32 am »
I've spent time with the properties you mention but cannot work out how to identify and loop through the selected rows.
I believe you can find an example here at form event SelRecInfoBtnClick()
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

 

TinyPortal © 2005-2018