AdvStringGrid do incorrect selection moving

The following test application has 2 problems.

1. ReadOnly cell (F8) is selection, When the cell L7 is selection, 
   and press Enter key twice, 

2. "Grid Index out of range" exception is occur,
   when select the Cell A1, and down cursor key.

I use AdvStringGrid ver 8.3.8.0 and Delphi XE8.

Test application
put a AdvStringGrid on TForm1, and OnCreate event is below.

procedure TForm1.FormCreate(Sender: TObject);
const
    mgArray : array[1..43] of TGridRect = (
        (Left: 1; Top:1; Right: 1; Bottom:8),
        (Left: 2; Top:1; Right:14; Bottom:1),
        (Left:15; Top:1; Right:26; Bottom:1),
        (Left:11; Top:3; Right:11; Bottom:7),
        (Left:10; Top:8; Right:11; Bottom:8),
        (Left:13; Top:8; Right:14; Bottom:8),
        (Left:15; Top:8; Right:26; Bottom:8),
        (Left:15; Top:6; Right:15; Bottom:7),
        (Left:24; Top:3; Right:24; Bottom:5),
        (Left:16; Top:3; Right:19; Bottom:3),
        (Left:16; Top:4; Right:19; Bottom:4),
        (Left:16; Top:5; Right:19; Bottom:5),
        (Left:20; Top:3; Right:23; Bottom:3),
        (Left:20; Top:4; Right:23; Bottom:4),
        (Left:20; Top:5; Right:23; Bottom:5),
        (Left:16; Top:7; Right:23; Bottom:7),
        (Left:12; Top:3; Right:13; Bottom:3),
        (Left:12; Top:4; Right:13; Bottom:4),
        (Left:12; Top:5; Right:13; Bottom:5),
        (Left:12; Top:6; Right:13; Bottom:6),
        (Left:12; Top:7; Right:13; Bottom:7),
        (Left: 6; Top:8; Right: 7; Bottom:8),
        (Left: 3; Top:3; Right: 6; Bottom:3),
        (Left: 3; Top:4; Right: 6; Bottom:4),
        (Left: 3; Top:5; Right: 6; Bottom:5),
        (Left: 3; Top:6; Right: 6; Bottom:6),
        (Left: 3; Top:7; Right: 6; Bottom:7),
        (Left: 7; Top:3; Right:10; Bottom:3),
        (Left: 7; Top:4; Right:10; Bottom:4),
        (Left: 7; Top:5; Right:10; Bottom:5),
        (Left: 7; Top:6; Right:10; Bottom:6),
        (Left: 7; Top:7; Right:10; Bottom:7),
        (Left:12; Top:2; Right:14; Bottom:2),
        (Left:24; Top:6; Right:25; Bottom:6),
        (Left:24; Top:7; Right:25; Bottom:7),
        (Left:25; Top:2; Right:26; Bottom:2),
        (Left:12; Top:2; Right:14; Bottom:2),
        (Left: 4; Top:8; Right: 5; Bottom:8),
        (Left: 8; Top:8; Right:11; Bottom:8),
        (Left: 2; Top:8; Right: 5; Bottom:8),
        (Left:16; Top:6; Right:17; Bottom:6),
        (Left:19; Top:6; Right:20; Bottom:6),
        (Left:22; Top:6; Right:23; Bottom:6)
    );

    roArray : array[1..62] of TGridCoord = (
        (X: 1; Y:1),
        (X: 1; Y:2),
        (X: 1; Y:3),
        (X: 1; Y:4),
        (X: 1; Y:5),
        (X: 1; Y:6),
        (X: 1; Y:7),
        (X: 1; Y:8),
        (X: 2; Y:1),
        (X: 2; Y:2),
        (X: 2; Y:3),
        (X: 2; Y:4),
        (X: 2; Y:5),
        (X: 2; Y:6),
        (X: 2; Y:7),
        (X: 2; Y:8),
        (X: 3; Y:8),
        (X: 4; Y:2),
        (X: 6; Y:2),
        (X: 6; Y:8),
        (X: 7; Y:8),
        (X: 8; Y:2),
        (X:10; Y:2),
        (X:11; Y:2),
        (X:12; Y:2),
        (X:12; Y:8),
        (X:13; Y:2),
        (X:14; Y:2),
        (X:14; Y:3),
        (X:14; Y:4),
        (X:14; Y:5),
        (X:14; Y:6),
        (X:14; Y:7),
        (X:15; Y:1),
        (X:15; Y:2),
        (X:15; Y:3),
        (X:15; Y:4),
        (X:15; Y:5),
        (X:15; Y:6),
        (X:15; Y:7),
        (X:15; Y:8),
        (X:16; Y:6),
        (X:16; Y:7),
        (X:17; Y:2),
        (X:17; Y:7),
        (X:19; Y:2),
        (X:19; Y:6),
        (X:19; Y:7),
        (X:20; Y:7),
        (X:21; Y:2),
        (X:21; Y:7),
        (X:22; Y:6),
        (X:23; Y:2),
        (X:23; Y:7),
        (X:24; Y:2),
        (X:25; Y:2),
        (X:26; Y:2),
        (X:26; Y:3),
        (X:26; Y:4),
        (X:26; Y:5),
        (X:26; Y:6),
        (X:26; Y:7)
    );

var i:integer;
begin
    AdvStringGrid1.ColCount := 27;
    AdvStringGrid1.RowCount :=  9;

    for i := 1 to AdvStringGrid1.ColCount-1 do begin
        AdvStringGrid1.Cells[i, 0] := Char(ord('A')+i-1);
    end;
    for i := 1 to AdvStringGrid1.RowCount-1 do begin
        AdvStringGrid1.Cells[0, i] := Char(ord('1')+i-1);
    end;

    AdvStringGrid1.Align := alClient;
    AdvStringGrid1.DefaultColWidth := 32;

    AdvStringGrid1.Options := AdvStringGrid1.Options + [goEditing];
    AdvStringGrid1.Navigation.AdvanceOnEnter           := true;
    AdvStringGrid1.Navigation.AdvanceOnEnterLoop       := false;
    AdvStringGrid1.Navigation.AdvanceSkipReadOnlyCells := true;
    for i := Low(mgArray) to High(mgArray) do begin
        AdvStringGrid1.MergeCells(
            mgArray.Left,
            mgArray.Top,
            mgArray.Right  - mgArray.Left+1,
            mgArray.Bottom - mgArray.Top+1);
    end;
    for i := Low(roArray) to High(roArray) do begin
        AdvStringGrid1.ReadOnly[roArray.X, roArray.Y] := true;
        AdvStringGrid1.Cells[   roArray.X, roArray.Y] := 'RO';
    end;
end;

We could not reproduce issue 1 with the latest version.
We could reproduce & fix issue 2 and the next update will have this fix.

Sorry, It seems that [ i ] of  mgArray[ i ] and roArray[ i ] of the source to which I contributed changes into a <em> tag.

I recompiled the test application at Delphi 10.2.3.
It's possible to download it from below.  It includes source code and exe.
The problem of 1 is reproduced on my environment.
I use latest Version 8.3.8.0.


I will be eliminated in about one week.

Details of the problem 1.

1. Click L7 cell.
2. Press Enter key.
    L7 cell will be edit mode.
3. Press Enter key again.
    Focus moves to F8 cell which is ReadOnly. It is incorrect.
    May it be right of a focus to move to a X7 cell?

We could reproduce it now and we'll investigate

Besides there are also some problems like problem 1.
cell I2 to R2. (correct I2 to P2)
cell L6 to C7. (correct L6 to R6)
cell R6 to C7. (correct R6 to U6)
and so on.

Thank you.

We traced & solved this issue and we can confirm this will be addressed in the next update

Thank you very much for correcting a problem.


I confirmed the problem by the new TAdvStringGrid version 8.3.8.1.
Then the following new problem occurred.

1. click cell C2.
2. Input 'a' to cell C2.
3. Enter key press. 
    --> cell E2 focused.
4. Input 'b' to cell E2.
5. Enter key press 
    --> cell G2 focused and 'b' is shown to cell C2.

In other words, when Enter key is pressed, the contents of the current cell 
are shown to the cell which previous focused cell.

This problem do not occur by the old version 8.3.8.0.

Thanks for reporting. It is now also fixed. Next update will address this.