[Closed] dot net listview selected
Hello,
How can I set the selected items in a dotnet listview control?
J.
Hi,
You can use the wrapper of the .NET ListView written by Chris Johnson in stdplugs\stdscripts : NET_ListViewWrapper.ms
With this wrapper you can use SelectLvItem method several times to select some items in a ListView.
There’s an example at the end of the script showing how to use this wrapper.
hmmm yes. thanks.
I’ve been using this as refernce but for some reason it doesn’t seem to be working for me
thanks again.
J.
Have you tried the example provided at the end of the script?
[Update]
Ok, I see the problem and I’ve fixed it. The problem comes from the fact that the ListView doesn’t get the focus, so even if items are selected they’re not shown in that state.
In the example provided I’ve added at the end of the rollout open handler function :
lvstuff.SelectLvItem lv 2
lv.Focus()
Add lv.Focus() in your code and it will work as expected.
ah-ha! so I’m not going completely mad.
yes, that seems to have fixed my problems. Thanksypuech
Josh.