ListView SelectedItems

  • Thread starter Thread starter Berryl Hesh
  • Start date Start date
B

Berryl Hesh

I'm setting the second item on the listView programmatically, this way:
_listView_Items.Items[0].Selected=true

I'm expected _listView.SelectedItems.Count to be > zero after that point,
but it is zero. The debugger confirms the 1st item's Selected property is
indeed true. Can you see what I'm doing wrong?

Thanks for sharing. BH
 
Hi,

It seems that adding an item to teh selecteditems list, makes it seleccted
but not the reverse.
 
It turned out that the solution was to create a windows Handle, which I did
with CreateControl(). A running windows form would have done that for me,
but I was testing a wrapper for the control so I needed to do it myself.

Thanks,
BH

Aflava said:
Hi,

It seems that adding an item to teh selecteditems list, makes it seleccted
but not the reverse.


--
Aflava
Windows Forms Components
http://www.aflava.com


Berryl Hesh said:
I'm setting the second item on the listView programmatically, this way:
_listView_Items.Items[0].Selected=true

I'm expected _listView.SelectedItems.Count to be > zero after that point,
but it is zero. The debugger confirms the 1st item's Selected property is
indeed true. Can you see what I'm doing wrong?

Thanks for sharing. BH
 
Back
Top