About ListView

  • Thread starter Thread starter RobbKirk
  • Start date Start date
R

RobbKirk

Guest
Hello,

I was very rarely using ListView, seems it is time to ask question:

I am building an element that way

ListViewItem BuildItem(string name, string fullName, bool state)
{
ListViewItem i = new ListViewItem(name, 0);
i.StateImageIndex = state ? 0 : 1;
i.ImageIndex = state ? 0 : 1;
i.SubItems.Add(fullName);
return i;
}
Then just add
userList.Items.Add(BuildItem(ID, fullName, true));

So, there is an image in the item (imageindex in imageList). Now I want to find an Item in that ListViewBox with some Name (ID) and change the image index to false value;

How should I perform the search thriugh that Items list? I can't get the ContainsKey as I do not use Key. How to add a Key to that kind of ListViewItem?

Continue reading...
 
Back
Top