EhLib.Com
https://forum.ehlib.com/en/

Record no error in display in DbgridEh
https://forum.ehlib.com/en/viewtopic.php?f=5&t=1145
Page 1 of 1

Author:  redsea71 [ 22 Mar 2022, 08:26 ]
Post subject:  Record no error in display in DbgridEh

Hi

I have a problem in record number in DbgridEh( all are 1) (Pls find the attachment Pict)

Pls your advice

Regards

Attachments:
ehlib.jpg
ehlib.jpg [ 14.2 KiB | Viewed 747 times ]

Author:  EhLibSupport [ 22 Mar 2022, 09:34 ]
Post subject:  Re: Record no error in display in DbgridEh

Hello

Check that your DataSet supports the correct value in the RecNo property.
Here is an example code to test.

Code:
procedure TForm1.Button3Click(Sender: TObject);
begin
  DBGridEh1.DataSource.DataSet.First;
  while not DBGridEh1.DataSource.DataSet.EOF do
  begin
    DBMemoEh1.Lines.Add(DBGridEh1.DataSource.DataSet.RecNo.ToString);
    DBGridEh1.DataSource.DataSet.Next;
  end;
  DBGridEh1.DataSource.DataSet.First;
end;

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/