Convert gridView to iList

Class library usage, coding and language questions.
Posts: 1
Joined: Mon May 23, 2011 7:23 pm

Convert gridView to iList

Post by minroNET » Mon May 23, 2011 7:27 pm


I am new to Ranorex, so I am sorry if my question is trivial.

I have a grid view collection (at least I think it is a grid view) and I need to iterate over it to access particular elements.

Now, I tried to convert it to IList (I need it to be iterable) but for some reason it does not work. Any ideas what am I doing wrong?


IList<Ranorex.Row> myRows = COlistOfRows.FindDescendants<Ranorex.Row>();

COlistOfRows is the highlighted element. I am using Ranorex 3.01.

Thank you
GridViewSpy.png (36.42 KiB) Viewed 1620 times

User avatar
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Convert gridView to iList

Post by Ciege » Mon May 23, 2011 7:35 pm

First, you say it does not work, can you elaborate as to what does not work means to you?

Second, according to the screenshot of Ranorex Spy you have listed there, there are no (visible) Ranorex.Row objects. So searching for all the descendant Ranorex.Row objects or COlistOfRows would return 0, since there are none to be found.

If you look two objects up from COlistOfRows, you see how Ranorex Spy displays a Row object.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!


User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Convert gridView to iList

Post by Support Team » Mon May 23, 2011 10:31 pm


please use the Spy to create a path that lists all your rows. Then use this same path in code like this:
IList<Ranorex.Row> rows = Host.Local.Find("/full/path/to/all/rows/here");
foreach (Ranorex.Row r in rows)
Instead of Host.Local you can use the adapter class of a unique containing element together with a relative path to all rows.

Ranorex Support Team