Jump to content


Photo

Vertical Scroll causes list index out of bounds, OnVerticalScroll not able to trap


  • Please log in to reply
No replies to this topic

#1 BelangerC

BelangerC

    Senior Member

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

Posted 24 July 2018 - 10:49 AM

Hi, Boki:

 

This is my simple NG6 grid which I create then fill with a dataset.

 

I am getting a strange error, because it is coming from NxCells6, L1561, GetChildRow, but this grid is not a treed grid.

First I get a showmessage, "Error: -1". I have searched through my code and could not find this, nor could I find it in your source code. Strange.

Then on clicking "ok", I get the madExcept bug report.

 

This happens when I use the vertical scroll bar and slide it upwards to the top of the grid. In the past I have been able to trap this in the OnVerticalScroll event, by looking at the position of the scroll bar and if -1 or greater than row count, exit. I have tested and the OnVerticalScroll is not trapping this issue.

 

When I first load the grid, I use an unfiltered dataset to fill the grid. Initially, moving the scroll bar beyond the end of the grid does nothing, i.e. no bug. But, when I apply a filter to the dataset (by adding a WHERE clause, and re-opening the query/dataset, then reloading the grid), that is when this bug can happen if I scroll up. 

 

My Grid fill routine simply ClearRows and then reloads the cells with the data from the query/dataset. And yet something about this second loading of the grid seems to be at issue. I do use the same grid fill routine for the initial and the filtered view of the grid. The only thing that is different is the filtered dataset.

 

Any thoughts?

Do you need some more information?

Chuck

 

 

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users