Ask a Question

The grid row´s index 20 is out of bounds

SOLVED
RodrigoJr
Occasional Contributor

The grid row´s index 20 is out of bounds

I'm having trouble using ClickCell in a Borland TDBGrid,
TestObj.ClickCell (Row, Column, Shift)
you are returning an error message:
'The grid row's index 20 is out of bounds'.
Can anyone help me?

4 REPLIES 4
tristaanogre
Esteemed Contributor

Not sure of the rest of the context around that line of code.... where are you assigning the values of Row, Column, etc?

 

Keep in mind, if you're doing this in a loop where you're basing things off of RowCount or ColumnCount, most grids have the Row and Column value on the cell as zero based.  So, while RowCount may be 20, the last actual Row number is 19.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
RodrigoJr
Occasional Contributor

the Grid contains 28 lines, only 15 lines are visible, I'm trying to use the clickcell is on line 21 and it returns the error.

If I click on a line below 15, the problem does not occur...

tristaanogre
Esteemed Contributor

I could be wrong, but it sounds like that, even though there are 28 lines in the grid, the rows that are available for cell referencing only number 0-14.  Your code sould take into consideration the visible rows, not the total rows, when determining what row to click on.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
RodrigoJr
Occasional Contributor

Thank you for your help!!!

cancel
Showing results for 
Search instead for 
Did you mean: