anchor.diff:    end
     else
     begin   // Selecting a Cell via mouse
  -    FFocusRow := FFirstRow + Longword((y - FMargin - hh) div FDefaultRowHeight);
  -    if FFocusRow > RowCount then
  -      FFocusRow := RowCount;
  -    cw := 0;
  -    for n := FFirstCol to ColumnCount do
  -    begin
  -      inc(cw, ColumnWidth[n]);
  -      if FMargin+cw >= x then
  -      begin
  -        FFocusCol := n;
  -        Break;
  -      end;
  -    end;
  +    MouseToCell(x, y, FFocusCol, FFocusRow);
     end;  { if/else }
     
     if not CanSelectCell(FFocusRow, FFocusCol) then
  
positive.code:     procedure   Update;
      procedure   BeginUpdate;
      procedure   EndUpdate;
    end;
  
  implementation
  
negative.code:   end;
  end;
  
  procedure TfpgBaseGrid.MouseToCell(X, Y: Integer; var ACol, ARow: Longword);
  var
    hh: integer;
    cw: integer;
    n: Longword;
  begin
    if ShowHeader then
      hh := FHeaderHeight+1
    else
      hh := 0;
  
    ARow := FFirstRow + Longword((y - FMargin - hh) div FDefaultRowHeight);
    if ARow > RowCount then
      ARow := RowCount;
  
    cw := 0;
    for n := FFirstCol to ColumnCount do
    begin
      inc(cw, ColumnWidth[n]);
      if FMargin+cw >= x then
      begin
        ACol := n;
        Break;
      end;
    end;
  end;
  
  
  end.
  
  