Jump to content


Photo

Getting "Error: -1" when Vertical Scrolling in NextGrid6


  • Please log in to reply
2 replies to this topic

#1 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 07 November 2022 - 06:54 PM

Hi, Boki:

Hope you are well.

 

This issue has been a problem ever since NextGrid6 was introduced. I used to get around it in NextGrid5 by catching the Row being < 0 in the OnVerticalScroll event. But that does not work any longer.

 

This happens pretty much all the time when scrolling up using the scroll bar of the grid.

 

My fix was to change your code, which I really do not like to do. So could you either provide an alternative or change your own code?

 

see:

TNxListGridView6.ScrollContentBy

 

else if DeltaY < 0 then { Scroll Up }
    begin
     //11/7/22 CB need to stop getting Row of -1 error
     if FFirstIndex > 0 then <== I added this line and it works to stop getting a -1 row index
       Dec(FFirstIndex);
 
      if FFirstIndex < 0 then
      begin
        ShowMessage('Error: ' + IntToStr(FFirstIndex));
      end;
 
Thank you! (for a great component)
Chuck


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 November 2022 - 09:01 PM

Thank you,

 

I'm trying to fix this error. It's unfortunately very unpredictable :(

 

I'm not able to easily recreate this bug, but for some people it happens. Can you maybe make a small demo project for me where this error happens.

 

I will remove this ShowMessage, but I will try to really fix this error.

 

Thank you.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 01 December 2023 - 06:52 AM

Hi, Boki:

 

As of the 9/2023 update this issue is still occurring and the code does not seem to have been changed. Still has the ShowMessage('Error') popup, plus getting ListIndex -1 out of bounds and requires users of my program to have to restart the program.

 

I actually did try to make a demo project for you last year but in such a simple grid, I could not get this error to happen. The grid is Treed for starters.

 

Seems to happen the most often after adding rows to the grid during execution of the program and then scrolling UP.  The above "fix" added to your code works. Could you add it to the next NextGrid6 release, so I don't have to keep re-adding it on my end?

Thank you,

Chuck






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users