[ACCEPTED]-Counting the rows in a TDbGrid-datagrid
Accepted answer
Both RowCount
and VisibleRowCount
are protected properties in TCustomGrid
that 3 are not exposed in TDBGrid
. But you can get round 2 that doing the following:
type
TDummyGrid = class(TDBGrid);
RowCount := TDummyGrid(MyDBGrid).RowCount;
VisibleRowCount := TDummyGrid(MyDBGrid).VisibleRowCount;
Be warned that 1 this includes the header.
You could try:
DBGrid1.DataSource.DataSet.RecordCount
Maybe there are better solutions. But 1 this worked for me.
I would use
TDbGrid.ApproxCount
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.