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;