Hi,
Need help, First not good in english,
I have listview displaying items from text file from designated directory (folder), i want search box and (TextBox1) and cmdButton (Button1) to search and display all items I search in third column or the ID Number.
EX:
Column 1: Date and Time:
Column 2: Name:
Column 3: ID Number:
08-08-2017 06:06:00, John Lucas, 1010000
08-08-2017 07:00:00, April Dun, 1010023
08-08-2017 08:45:00, Kevin Elmo, 1010014
08-08-2017 09:06:00, John Lucas, 1010000
08-08-2017 10:24:00, Ed Olivia, 1010012
08-08-2017 11:47:00, John Lucas, 1010000
08-08-2017 12:56:00, Liza Ben, 1010001
I want to display data (items) of John Lucas by searching ID Number and display it in listview (another listview)
What I have tried:
'This is the code to display my items from text file only, I don't have any idea and Im asking for some help from you, TIA.'
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load, MyBase.DockChanged
lvDETAILS.View = View.Details
lvDETAILS.Columns.Add("Date/Time:", 220, HorizontalAlignment.Left)
lvDETAILS.Columns.Add("Employee Name:", 280, HorizontalAlignment.Left)
lvDETAILS.Columns.Add("ID Number:", 120, HorizontalAlignment.Left)
lvDETAILS.Columns.Add("Department:", 250, HorizontalAlignment.Left)
lvDETAILS.Columns.Add("User Type:", 200, HorizontalAlignment.Left)
lvDETAILS.Columns.Add("ESD Check Result:", 200, HorizontalAlignment.Left)
Dim File_Name As String = "D:\esdcheck\DET.dll"
Dim objReader As New IO.StreamReader(File_Name)
Dim newarray(6) As String
Dim DateTime As String
Dim Name As String
Dim IDNum As String
Dim Department As String
Dim UserType As String
Dim ESDResult As String
Do While objReader.Peek <> -1
newarray = objReader.ReadLine().Split(",")
DateTime = newarray(0)
Name = newarray(1)
IDNum = newarray(2)
Department = newarray(3)
UserType = newarray(4)
ESDResult = newarray(5)
Dim x As Integer = lvDETAILS.Items.Add(New ListViewItem(New String() {DateTime})).Index 'Para sa Listview unang Column depende sa base sa index
lvDETAILS.Items.Item(x).SubItems.Add(Name) 'yung 'x' po na yun ay number of index na nakaset per column., ilalagay sa second column depende sa index
lvDETAILS.Items.Item(x).SubItems.Add(IDNum) 'sunod sunod lang po ang pag lagay depende sa dami ng column
lvDETAILS.Items.Item(x).SubItems.Add(Department) 'yeah
lvDETAILS.Items.Item(x).SubItems.Add(UserType) 'yeah
lvDETAILS.Items.Item(x).SubItems.Add(ESDResult) 'yeah !!! eto na yung last!
End Sub