WOW!
When I look at the code examples you tried all of them seem much more complicated that one I will present you.

So here is my example which is much easier and works perfectly. It uses Forms OnCanResize notification event.
Code:
procedure TForm3.FormCanResize(Sender: TObject; var NewWidth,
  NewHeight: Integer; var Resize: Boolean);
var HorizontalBorderWidth: Integer;
    VerticalBorderWidth: Integer;
    X,Y: Integer;
      //Constants defining row anbd column dimensions
const ColumnWidth = 20;
      RowHeight = 20;
begin
    //Calculate number of pixels used for left and right Form border
    //We use this to calculate needed horizontal Form size to get certain Form ClientWidth
    HorizontalBorderWidth := Width - ClientWidth;
    NewWidth := ((NewWidth div ColumnWidth) * ColumnWidth) + HorizontalBorderWidth;
    //Calculate number of pixels used for top and bottom Form border
    //We use this to calculate needed vertivcal Form size to get certain Form ClientHeight
    VerticalBorderHeight := Height - ClientHeight;
    NewHeight := ((NewHeight div RowHeight) * RowHeight) + VerticalBorderHeight;
    //Draw a rid for easier referencing of Form size
    for X := 0 to 100 do
    begin
        Form3.Canvas.MoveTo(X*ColumnWidth,0);
        Form3.Canvas.LineTo(X*ColumnWidth,2000);
    end;
    for Y := 0 to 100 do
    begin
        Form3.Canvas.MoveTo(0,Y*RowHeight);
        Form3.Canvas.LineTo(2000,Y*RowHeight);
    end;
end;
If you want your Form to be resized in a way so that some Panel on your Form would have suitable size for showing only whole rows and columns you only need to change the way how HorizontalBorderWidth and VerticalBorderHeight are calculated.
Code:
HorizontalBorderWidth := Width - Panel.ClientWidth;
VerticalBorderHeight := Height - Panel.ClientHeight;
This code should probably work in any version of Delphi and Lazarus.