Hi, Boki:
Have a consistent error when scrolling grids down, then up to their top row. (Now I am using Delphi 10.2.)
I get an error in madExcept for the row = -1 and also a showmessage error from your code.
What can I do to keep this error and your showmessage from firing?
In my code for OnVerticalScroll:
WITH Grid DO
BEGIN
// if using scroll bar, it can go past the last row index causing a list
// index out of bounds
IF (Position > RowCount - 1) OR (Position < 0) THEN
BEGIN
exit;
END;
Repaint; // needed for XE2 paint problems
END;
The above is not trapping this condition. In your code,
procedure TNxListGridView6.ScrollContentBy(DeltaX, DeltaY: Integer);
if DeltaY < 0 then { Scroll Up }
begin
Dec(FFirstIndex);
if FFirstIndex < 0 then
begin
ShowMessage('Error: ' + IntToStr(FFirstIndex));
end;