David Smith

David Smith

  • NA
  • 2k
  • 0

ListView Selected Index Highlight Update

Jul 19 2016 6:21 AM

I have an issue with updating the selected index to be highlight. the issue is that when i set the selected item to be true. Row 1 and Row 2 are now highlight which is not the expected behavior. I just want to only highlight 1 item as i am adding them to the list. The row thats updated or added to the list is the exacted behavour I want. Review my logic below to see what I am doing wrong.

item1.SubItems.Add("");
item1.SubItems.Add(red.ToString());
item1.SubItems.Add(blue.ToString());
lvColorSystem.Items.Add(item1);
myColorReport.Add(color_data);
int index = myColorReport.Count - 1;
lvColorSystem.Select();
lvColorSystem.Items[index].Selected = true;
lvColorSystem.Items[index].Focused = true;


Answers (1)