Multiselect grid

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GaryShelton
Posts: 5
Joined: Tue 22 Jan 2019 06:29

Multiselect grid

Post by GaryShelton » Wed 13 Feb 2019 16:15

TMyTable 9.3.9 MariaDB, Delphi 10.3

How do I get the values from a multiselected grid?
the standard way GotoBookmark(Pointer(DBGrid1.SelectedRows.Items));

does not work. I found this on the Embarcadero forum from 2 years ago
Grid.Datasource.DataSet.GotoBookmark(TArray(Pointer(Grid.SelectedRows.Items)));

When I try it:
dsRepeatServiceDates.DataSet.GotoBookmark(TArray(Pointer(grdRepeatServiceGrid.SelectedRows.Items)))

I get an error [dcc32 Error] uRepeatServicesGrid.pas(97): E2003 Undeclared identifier: 'TArray'

I have System.SysUtils declared in my uses clause

After checking the Delphi documentation I tried adding System.TArray to the uses and got
[dcc32 Fatal Error] uRepeatServicesGrid.pas(10): F2613 Unit 'System.TArray' not found.

Any help would be appreciated

Gary

GaryShelton
Posts: 5
Joined: Tue 22 Jan 2019 06:29

Re: Multiselect grid

Post by GaryShelton » Wed 13 Feb 2019 20:27

Solved in Idera Embarcadero forum

Pointer must be cast to a Byte array so TArray<Byte>, or TBytes or TBookmark witch is an alias for a TByte array

dsRepeatServiceDates.DataSet.GotoBookmark(TBookmark(Pointer(grdRepeatServiceGrid.SelectedRows.Items)));

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Multiselect grid

Post by ViktorV » Thu 14 Feb 2019 07:20

It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.

Post Reply