Hello,
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?
Code:
IList<Ranorex.Row> myRows = COlistOfRows.FindDescendants<Ranorex.Row>();
COlistOfRows is the highlighted element. I am using Ranorex 3.01.
Thank you
Convert gridView to iList
Convert gridView to iList
- Attachments
-
- GridViewSpy.png (36.42 KiB) Viewed 1577 times
Re: Convert gridView to iList
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.
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!
Ciege...
Ciege...
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Convert gridView to iList
Hello,
please use the Spy to create a path that lists all your rows. Then use this same path in code like this:
Regards,
Roland
Ranorex Support Team
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) r.Click();Instead of Host.Local you can use the adapter class of a unique containing element together with a relative path to all rows.
Regards,
Roland
Ranorex Support Team