I am displaying records like p.o.no, item no etc. in Listview. I want write code for searching perticular string may be item no or p.o.no. for that i ve written following code

For ivar = 1 To ListView1.ListItems.Count
If ListView1.ListItems(ivar).ListSubItems(4).Text = txtsearch.Text Then

ListView1.ListItems(ivar).Selected = True
End If
Next

in txtsearch.Text i m entering text which i want to search.is this code correct?

above code is not working ,it is not selecting the complete row which having the entered text.

please give me solution.