Hi everyone~
I'm currently borrowing my friend's machine (the license belongs to him) to create the app.
So, as the title indicates, I would like to know how to search in ListView. Basically, it would need to be able to search and filter the contents of a ListView depending on what you type in. I found a similar thread, where someone replied by saying this :
Sub EditTextSearch_TextChanged (Old As String, New As String)
If s.Len(s.Trim(New)) < 1 Then
ListViewSearch.Clear
Return
End If
holdp = pointer.Position
thm = pointer.RowCount - 1
Dim LVlbl As Label
LVlbl = ListViewSearch.SingleLineLayout.Label
LVlbl.Color = Colors.Gray
ListViewSearch.Clear
If RBnames.Checked Then
For l = 0 To thm
pointer.Position = l
seekvar = pointer.GetString ("name")
If s.At(s.Upper(seekvar), s.Upper(New)) > -1 Then
ListViewSearch.AddSingleLine(seekvar)
ListViewSearch.Invalidate
DoEvents
End If
Next
End If
If RBnotes.Checked Then
For l = 0 To thm
pointer.Position = l
seekvar = pointer.GetString ("enotesee")
If s.At(s.Upper(seekvar), s.Upper(New)) > -1 Then
ListViewSearch.AddSingleLine(pointer.GetString ("name"))
ListViewSearch.Invalidate
DoEvents
End If
Next
End If
pointer.Position = holdp
End Sub
(I couldn't understand what the reply meant, as I'm a beginner in Basic4Android programming).
Any help/advice/tips is appreciated, just be gentle to me, noob here :sign0104:
*Oh, also, could anyone tell me how to put the code in the proper format? Thanks*
I'm currently borrowing my friend's machine (the license belongs to him) to create the app.
So, as the title indicates, I would like to know how to search in ListView. Basically, it would need to be able to search and filter the contents of a ListView depending on what you type in. I found a similar thread, where someone replied by saying this :
Sub EditTextSearch_TextChanged (Old As String, New As String)
If s.Len(s.Trim(New)) < 1 Then
ListViewSearch.Clear
Return
End If
holdp = pointer.Position
thm = pointer.RowCount - 1
Dim LVlbl As Label
LVlbl = ListViewSearch.SingleLineLayout.Label
LVlbl.Color = Colors.Gray
ListViewSearch.Clear
If RBnames.Checked Then
For l = 0 To thm
pointer.Position = l
seekvar = pointer.GetString ("name")
If s.At(s.Upper(seekvar), s.Upper(New)) > -1 Then
ListViewSearch.AddSingleLine(seekvar)
ListViewSearch.Invalidate
DoEvents
End If
Next
End If
If RBnotes.Checked Then
For l = 0 To thm
pointer.Position = l
seekvar = pointer.GetString ("enotesee")
If s.At(s.Upper(seekvar), s.Upper(New)) > -1 Then
ListViewSearch.AddSingleLine(pointer.GetString ("name"))
ListViewSearch.Invalidate
DoEvents
End If
Next
End If
pointer.Position = holdp
End Sub
(I couldn't understand what the reply meant, as I'm a beginner in Basic4Android programming).
Any help/advice/tips is appreciated, just be gentle to me, noob here :sign0104:
*Oh, also, could anyone tell me how to put the code in the proper format? Thanks*