this error comes when there is no such index available in object
it's about you have 3 cards B,C,D but I am asking for 'A' or 'Z'
grid1 have 2 rows
Now if we try to fetch 3rd row (means index=2) this kind of error occur
check your code some where same thing happened as above example
to solve error
write protective conditions so that such situation never occur
if (RowId > grid1.rows.count-1)