cancel
Showing results for 
Search instead for 
Did you mean: 

The grid row´s index 20 is out of bounds

SOLVED
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?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: The grid row´s index 20 is out of bounds

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
[Community Expert Group]
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
Extensions available
4 REPLIES 4
Community Hero

Re: The grid row´s index 20 is out of bounds

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
[Community Expert Group]
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
Extensions available
Occasional Contributor

Re: The grid row´s index 20 is out of bounds

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...

Community Hero

Re: The grid row´s index 20 is out of bounds

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
[Community Expert Group]
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
Extensions available
Occasional Contributor

Re: The grid row´s index 20 is out of bounds

Thank you for your help!!!

New Here?
Join us and watch the welcome video:
Watch the new Interview