searching in listview

searching in listview true textbox

Page 1 of 1

3 Replies - 3978 Views - Last Post: 06 May 2008 - 05:40 AM Rate Topic: -----

#1 IDIS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 30-April 08

searching in listview

Post icon  Posted 30 April 2008 - 05:41 AM

Hello,

My name is idi and today i ahve come to this side for first time. THis is really great!
I have a listview with playlist in the listview, true textbox i want to search in the listview. For example in the textbox i fill in the letter A and all title of songs beginning with letter A come to top of the listview, when i Fill in letters AB al songs beginning with AB are in top of the listview. I really don't now how to do tis. I have searched the net. The following i have tried. Please help me.

	 Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
	
		ListView1.Items.Clear()
		ListView1.Sorting = SortOrder.Ascending
		Dim teller As Integer
		For ix As Integer = 0 To ListView1.Items.Count - 1
			Dim ls As String = ListView1.Items(ix).Text

		'	If String.Compare(ls.Substring(0, TextBox2.Text.Length), TextBox2.Text, True) = 0 Then
		'		ListView1.Items(ix).Selected = True
		'		'ListView1.Items(ix).EnsureVisible()
		'		Exit For
		'	End If
		'Next ix
	End Sub 




With kind regards,

idi

This post has been edited by IDIS: 30 April 2008 - 05:42 AM


Is This A Good Question/Topic? 0
  • +

Replies To: searching in listview

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5201
  • View blog
  • Posts: 13,944
  • Joined: 18-April 07

Re: searching in listview

Posted 30 April 2008 - 10:59 AM

Are you wanting to only show those songs which start with the letters they type in or are you looking for it to scroll down through the playlist to the songs that begin with the letters they typed? The first choice would be a subset of the original list and the second choice would be the entire list by scrolled through to the correct area in the list.

:)
Was This Post Helpful? 0
  • +
  • -

#3 IDIS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 30-April 08

Re: searching in listview

Posted 30 April 2008 - 11:35 AM

View PostMartyr2, on 30 Apr, 2008 - 10:59 AM, said:

Are you wanting to only show those songs which start with the letters they type in or are you looking for it to scroll down through the playlist to the songs that begin with the letters they typed? The first choice would be a subset of the original list and the second choice would be the entire list by scrolled through to the correct area in the list.

:)

the songs thats start with the letters givvin by text box in top of listview the rest under that.
thanks for the reply
Was This Post Helpful? 0
  • +
  • -

#4 IDIS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 30-April 08

Re: searching in listview

Posted 06 May 2008 - 05:40 AM

can anybody help me?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1