Page 1 of 1

Multiselect grid

Posted: Wed 13 Feb 2019 16:15
by GaryShelton
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

Re: Multiselect grid

Posted: Wed 13 Feb 2019 20:27
by GaryShelton
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)));

Re: Multiselect grid

Posted: Thu 14 Feb 2019 07:20
by ViktorV
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.