Forum Discussion

rbarbish's avatar
rbarbish
Occasional Contributor
13 years ago

Index Error

I receive this error when I spy a WPF object's "Items" property. What I think is happening is as you can see the datagrid on the left has no rows/records.  Another datagrid previously opened did have Items (DG.Items.Item(0) and DG.Items.Item(1)). I believe testcomplete's spy believes that this is the same datagrid  as before (maybe by looking at the fullname property?) even though it isn't.

1 Reply

  • ecrespo's avatar
    ecrespo
    Occasional Contributor
    I think that by default, you are trying to access Item(0), which in your case does not exist yet. That's why it gives an Index Error, there are no Items, and therefore, no indexes.

    Items.Count   = 0