Recent

Author Topic: memdataset record pointer  (Read 1410 times)

Packs

  • Sr. Member
  • ****
  • Posts: 425
memdataset record pointer
« on: July 29, 2023, 06:02:19 am »
I have memdataset and grid and navigation bar

all are connected with each other . when I move record pointer from one record to another record grid and navigation bar both are working ,
but when I try to access mem.fieldbyname('column1').asstring it is showing always first record .

why memdataset pointer is not moving .

GAN

  • Sr. Member
  • ****
  • Posts: 378
Re: memdataset record pointer
« Reply #1 on: July 29, 2023, 07:40:31 am »
Because you need to select the record in the grid (click) or select it by the dataset.
The easiest way: click it.
Lazarus 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

Packs

  • Sr. Member
  • ****
  • Posts: 425
Re: memdataset record pointer
« Reply #2 on: July 29, 2023, 08:24:03 am »
Yes . I have done it .
    DBGrid_cheque.DataSource.DataSet.GotoBookmark(
      Pointer(DBGrid_cheque.SelectedRows.Items[0]));

This type of issue I have never face in delphi .

Technically it should work because dataset is link with grid .

when grid record pointer move dataset pointer should move .


wp

  • Hero Member
  • *****
  • Posts: 12579
Re: memdataset record pointer
« Reply #3 on: July 29, 2023, 10:53:03 am »
I am attaching a simple demo with Memdataset, DBGrid and DBNavigator which behaves as expected.

Packs

  • Sr. Member
  • ****
  • Posts: 425
Re: memdataset record pointer
« Reply #4 on: July 30, 2023, 08:51:37 am »
Thanks for the code

 

TinyPortal © 2005-2018