|
procedure TfrmTSTS_S_13_003.OnGridRowChanging(Sender: TObject;
OldRow, NewRow: Integer; var Allow: Boolean);
var
Grid: TAdvColumnGrid;
I, C, T, R: Integer;
ORow: Array [0..2] of Integer;
NRow: Array [0..2] of Integer;
begin
if Sender is TAdvColumnGrid then begin
Grid := TAdvColumnGrid(Sender);
for I := 0 to Grid.VisibleColCount + Grid.FixedCols - 1 do begin
C := Grid.LeftCol + I;
R := OldRow - Grid.FixedRows;
if (R mod 3) = 0 then begin
ORow[0] := OldRow;
ORow[1] := OldRow + 1;
ORow[2] := OldRow + 2;
end
else if (R mod 3) = 1 then begin
ORow[0] := OldRow - 1;
ORow[1] := OldRow;
ORow[2] := OldRow + 1;
end
else begin
ORow[0] := OldRow - 2;
ORow[1] := OldRow - 1;
ORow[2] := OldRow;
end;
Grid.RepaintCell(C, ORow[0]);
Grid.RepaintCell(C, ORow[1]);
Grid.RepaintCell(C, ORow[2]);
R := NewRow - Grid.FixedRows;
if (R mod 3) = 0 then begin
NRow[0] := NewRow;
NRow[1] := NewRow + 1;
NRow[2] := NewRow + 2;
end
else if (R mod 3) = 1 then begin
NRow[0] := NewRow - 1;
NRow[1] := NewRow;
NRow[2] := NewRow + 1;
end
else begin
NRow[0] := NewRow - 2;
NRow[1] := NewRow - 1;
NRow[2] := NewRow;
end;
Grid.RepaintCell(C, NRow[0]);
Grid.RepaintCell(C, NRow[1]);
Grid.RepaintCell(C, NRow[2]);
end;
end;
end;
|