Can't get item text of listview via GetItemText Method : Automation API

Can't get item text of listview via GetItemText Method

Class library usage, coding and language questions.

Can't get item text of listview via GetItemText Method

Postby sanliuus » Thu May 29, 2008 6:00 am

Hi,

I want to get the item text of a listview control. Here is the code.
Code: Select all
for (int i = 0; i < listview.ItemCount; i++)
{
  for (int j = 0; j < listview.ColumnCount; j++)
  {
     Console.WriteLine("Item[{0}, {1}]= {2}", i, j, cntctList.GetItemText(i, j));
   }
}


But all printout is null. I can get the correct ItemCount and ColumnCount. Any body know what's wrong with my code?

Thanks & Regards!
sanliuus
 
Posts: 2
Joined: Tue May 06, 2008 5:49 pm

Postby Support Team » Thu May 29, 2008 4:38 pm

What kind of listview is it (Win32, .NET System.Windows.Forms, ...)? Could you please post its classname!

Have you tried the ListView.SelectItem(string) method?

Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests