Pity one cannot just ask for the number of visible rows in the Tdbgridview, that would be a fast solution like when you get the rows in a normal Listview.
Do you mean the
visible rows on screen in the TDBGrid? and not the existing rows in the TDataset?
(That was not clear from your original question where you asked for the recordcount.)
Then you can just look at this:
type
TCustomDBGridHack = class(TCustomDBGrid);
function GetVisibleRows(DBGrid: TCustomDBGrid): Integer;
begin
Result := TCustomDBGridHack(DBGrid).VisibleRowCount;
end;
But my guess is you want the recordcount and that's only visible when you do a Last/First.
O, you could also adjust the BufferCount of the TDataset
(That should do the same as a Last/First... i.e. reading all records in one go but I'm not sure how this is done in TDBF).