Puffeltje
2014-04-24T18:18:54Z
How can i see the rowindex of the first visible row ?

I use iGRID V3.0.0.0 within VB2010 and tried the folowing code:


Dim mySTART, myEND As iGCell
Dim mySTARTbounds, myENDbounds As Rectangle
GRID.GetStartEndCells(mySTART, mySTARTbounds, myEND, myENDbounds)
Dim firstline = mySTART.RowIndex

if i set no references i get the error "Type 'iGCell' is not defined"
if i set references to 'TenTec.Windows.iGridLib' this error isn't showed but when i start my project i get the error: "An error occured creating the form. See Exception.InnerException for detail. The error is: Specified argument was out of the range of valid values."
Igor/10Tec
2014-04-25T16:07:33Z
Send us please a sample we can use to reproduce this problem.
Puffeltje
2014-04-25T20:53:48Z
i made a testprogram with only a grid and a button to show the first line. This works errorfree.
I think some object used in my project generates the error. I can make a zipfile from my project but i don't want it go public over this forum.
Puffeltje
2014-04-27T08:27:09Z
Today i started my project to see if i can eliminate the problem but all runs errorfree. No more errors, and i get the first rowindex with the code from post #1. No more need to send in my project for investigation.
Puffeltje
2014-04-27T13:25:39Z
Grrr, the error apears again!!!
But I found my mistake: when my program starts sometimes it tries to read the firstline index, but sometimes it doesn't (depending on a value in the ini-file). The error appears when the grid has no rows, so there is no firstline index. Because the error rises before the form is showed i got the error that the form can't be created.
Now before i read the firstline index i check if there are any rows in the grid. If not i set the firstline index to -1.

Problem solved!