anchor.diff:    FDrawGrid.ColCount := Length(FDataTable.Columns);
   end;
   
  +function TCustomVisualGrid.ClientRowCount: Integer;
  +begin
  +  Result := ((FDrawGrid.ClientHeight - FDrawGrid.GridLineWidth) div FDrawGrid.DefaultRowHeight) - FDrawGrid.FixedRows;
  +  if Result = 0 then
  +    Result := 1;
  +  FDrawGrid.VisibleRowCount;
  +end;
  +
  +function TCustomVisualGrid.CheckRangeForPageSize(var APageSize: Integer
  +  ): boolean;
  +begin
  +  if APageSize <= 0 then
  +  begin
  +    APageSize:=FPageSize;
  +    Exit(False);
  +  end
  +  else if APageSize > 1000000 then
  +  begin
  +    APageSize:=1000000;
  +    Exit(False);
  +  end;
  +  Result := True;
  +end;
  +
   procedure TCustomVisualGrid.SetDataSource(ADataSource: IDataSource);
   begin
     if FDataSource = ADataSource then
  
positive.code:   if updPageSize in FGUIUpdates then
      Exit;
    LPageSize:=StrToIntDef(FPageSizeEdit.Text, FPageSize);
    if LPageSize <= 0 then
    begin
      LPageSize:=FPageSize;
      SetPageSizeEditText(IntToStr(FPageSize));
    end
    else if LPageSize > 1000000 then
    begin
      LPageSize:=1000000;
      SetPageSizeEditText('1000000');
    end;
    PageSize:=LPageSize;
  end;
  
  
negative.code:     procedure PageSizeEditChange(Sender: TObject);
      procedure PageNavigationClick(Sender: TObject);
    private
      FAutoPageSize: boolean;
      FCanPage: boolean;
      FCanSearch: boolean;
      function GetCanvas: TCanvas;
      procedure SetAutoPageSize(AValue: boolean);
      procedure SetCanPage(AValue: boolean);
      procedure SetCanSearch(AValue: boolean);
  {$IFDEF VISUALGRID_DEBUG}
      procedure ClickTest(Sender: TObject);
  {$ENDIF}
      procedure SetPageIndex(const Value: Integer);
      procedure SetPageSize(Value: Integer);
    protected { TComponent }
      procedure Loaded; override;
    protected { TControl }
      procedure BoundsChanged; override;
      procedure DelayedBoundsChange(Sender: TObject);
    protected
      FGUIUpdates: TUpdateOfVisualGridGUI;
      FDataTable: TDataTable;
  