i am facing an problem in selecting an particular row with row number but i was failed to perform because there is no event like Item(VB) in c#.
My code is like
Ranorex.TableTag tagtable = new Ranorex.TableTag (repo.Home.Loss.tblSelect);
Ranorex.TBodyTag tb=tagtable.FindSingle<Ranorex.TBodyTag>("./tbody");
System.Collections.Generic.IList<TrTag> trSel = tb.Find<Ranorex.TrTag>("./tr");
MessageBox.Show(trSel.Count.ToString());
System.Collections.Generic.IList<TdTag> tdSel = tb.Find<Ranorex.TdTag>("./tr/td");
MessageBox.Show(tdSel.Count.ToString());
i can get the count but i cant select an item.
totally tr has 12 rows and td has 140 columns and i want to access the 10row How to get the element in c# ?
Vb code which is working correctly:
Dim progTbl As Ranorex.TableTag = repo.Home.Loss.tblSelect
Dim tb As Ranorex.TBodyTag = progTbl.FindSingle(Of Ranorex.TBodyTag)("./tbody")
Dim tr As System.Collections.Generic.List(Of TrTag)= tb.Find(Of Ranorex.TrTag)("./tr")
Dim td As System.Collections.Generic.List(Of TdTag)= tb.Find(Of Ranorex.TdTag)("./tr/td")
msgbox(td.Count)
msgbox(td.Item(14).InnerText.ToString)
this is working fine but in c# it dosent have an item property which was highlited in red color
Selecting an item from tr which has 12 rows.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Selecting an item from tr which has 12 rows.
Hi,
The indexers in C# and Vb .Net are different. Please take a look to following documentation
http://msdn.microsoft.com/en-us/library/2549tw02.aspx
Here is a little example for indexers in C# and VB .Net
Peter
Ranorex Support Team
The indexers in C# and Vb .Net are different. Please take a look to following documentation
http://msdn.microsoft.com/en-us/library/2549tw02.aspx
Here is a little example for indexers in C# and VB .Net
'VB .Net msgbox(td.Item(14).InnerText)
//C# MessageBox.Show(td[14].InnerText);Regards,
Peter
Ranorex Support Team
Re: Selecting an item from tr which has 12 rows.
thanks problem solved.