views:

216

answers:

2

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, is whether the count is more than zero.

Using delphi Turbo Professional

+1  A: 

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

Tom1952
Would that give me the filtered row count or the total row count?
ChuckO
I'm pretty sure it's the filtered count. You can try it. Also check the link on Bruce's answer above.
Tom1952
+1  A: 

You can check DataSet.IsEmpty property

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