I want to adjust a TDBGrid height given a VisibleRows parameter. the grid may or may not have titles.
Suppose I select 100 records from the db, but I want the grid height to adjust to show the first 10 rows (make them visible). the dataset will still hold 100 records.
i.e.
procedure SetVisibleRows(DBGrid: TCustomDBGrid; VisibleRows: Integer);
begin
...
DBGrid.Height := ???
end;
I know how to get the visible rows:
type
TCustomGridHack = class(TCustomGrid);
function GetVisibleRows(DBGrid: TCustomDBGrid): Integer;
begin
Result := TCustomGridHack(DBGrid).VisibleRowCount;
end;
But, is there a way to set the VisibleRowCount?