vb.net - ListView : Fetch data from selected item -


i have created listview , populated using datatable..
worked fine...
added checkbox items.. want when last column's value of item "true" checkbox of same item checked.

i tried following code...

if lstviewhelp.items.count <> 0     each item listviewitem in lstviewhelp.items         if lstviewhelp.focuseditem.subitems(10).text = "true"             lstviewhelp.focuseditem.checked = true         end if     next end if 

i getting following error object reference not set instance.
tried many links no proper solution found...!

you can selected index listview.selectedindexcollection using selectedindices . add foreach loop on selected indexes , edit subitem.

dim indexes listview.selectedindexcollection = me.listviewhelp.selectedindices  each index in indexes      if me.listviewhelp.items(index).subitems(10).text = "true"         lstviewhelp.items(index).checked = true     end if  next 

and if want check items can use for loop

for = 0 me.listviewhelp.items.count - 1            if me.listviewhelp.items(i).subitems(10).text = "true"             lstviewhelp.items(i).checked = true           end if next 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -