开发者

How to determine Delphi DBGrid Row Count

开发者 https://www.devze.com 2022-12-28 02:56 出处:网络
I have a DBGrid that shows a filtered view of a dBASE table. DBGrid has a property called RowCount but is marked private.

I have a DBGrid that shows a filtered view of a dBASE table.

DBGrid has a property called RowCount but is marked private.

How do I determine the row count?

All I really need to know,开发者_Go百科 is whether the count is more than zero.

Using delphi Turbo Professional


You can check the .RecordCount property of the grid's DataSource's DataSet, the DBASE table itself.


You can check DataSet.IsEmpty property

if not DBGrid.DataSource.DataSet.IsEmpty then
  ShowMessage(Format('DBGrid ''%s'' has more than one record.', [DBGrid.Name]));
0

精彩评论

暂无评论...
验证码 换一张
取 消