Page 1 of 1

Ranorex.Table and LINQ

Posted: Tue Feb 02, 2010 5:34 pm
by atom
Hiya

If i have a Ranorex.Table control, that contains 20 columns and 5000 rows, and i want to search to find all rows that have:

- Column1 = "Hello"
- Column2 = "World"
- Column3 = "Nice"
- Column4 = "Day"
- etc.


I could build a quite large ranorex xpath for that.
What would be better (I dont know if its possible) is to write a LINQ query on the Table.Rows collection
e.g.

Dim myrows = From row in Table.Rows where row.item("Column1") = "Hello" ... select row

Is that possible?

Regards

Re: Ranorex.Table and LINQ

Posted: Wed Feb 03, 2010 9:28 pm
by Support Team
Sure, you can use LINQ to select rows in a table. Ranorex uses standard .NET collection types that LINQ can be used with, e.g. the Table.Rows property returns a list of type System.Collections.Generic.IList<Row>. In your situation using LINQ is definitely preferable to RanoreXPath, since the C# or VB.NET compiler can check your statement for syntax errors.

Regards,
Alex
Ranorex Support Team

Re: Ranorex.Table and LINQ

Posted: Thu Feb 04, 2010 10:26 am
by atom
nice, thanks!