Small 'fix' to DBGrid (Delphi 1.02)

I reported some time ago on a Delphi newsgroup that DBGrids misbehave if
you vertically resize them when the rowselect option is set.
Specifically if you shrink the height so that the highlighted row is
below the visible client area, the grid loses some lines (i.e. ends up
with less lines than would fill it, and a {*word*193} blank gap at the
bottom). This was proving a serious problem to me because I was using a
DBGrid which was being automatically resized quit often.

I have made a one-line fix to the VCL source for this small bug, which I
copy below.

procedure TCustomDBGrid.UpdateRowCount;
begin
  if RowCount <= FTitleOffset then RowCount := FTitleOffset + 1;
  FixedRows := FTitleOffset;
  with FDataLink do
    if not Active or (RecordCount = 0) then
      RowCount := 1 + FTitleOffset
    else
    begin
      RowCount := 1000;
      FDataLink.BufferCount := VisibleRowCount;
      RowCount := RecordCount + FTitleOffset;
      TopRow := FTitleOffset; {Added to fix bug in VCL}
      UpdateActive;
    end;
end;

Mark

Mark Williams                   M...@polyhdrn.demon.co.uk
Polyhedron Software Ltd.        
Programs for Programmers - QA, Compilers, Graphics
************ Visit our Web site on http://www.polyhedron.co.uk/ ************