Can't get item text of listview via GetItemText Method

Class library usage, coding and language questions.
sanliuus
Posts: 2
Joined: Tue May 06, 2008 4:49 pm

Can't get item text of listview via GetItemText Method

Post by sanliuus » Thu May 29, 2008 5: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!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Thu May 29, 2008 3: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