M
musa.biralo
Hi there,
Knowing little is the worst thing . I am having trouble with this
code... I am beginner and this is not working for me at all...
I am simply trying to list my listview. I tried googling hours but end
up here.. .Please help... My listview is in detail mode. When i run
the following code, the listview becomes longer (vertical scroll pops
up) but there is nothing in the list, neither does the column header
shows up...
Dim userListView As ListView = Me.listViewUN
userListView.BeginUpdate()
userListView.Items.Clear()
For i As Integer = 0 To 9
Dim lvi As ListViewItem = userListView.Items.Add
(i.ToString)
lvi.Text = "Row " & i.ToString
lvi.SubItems.Add(CStr(i + 10))
lvi.SubItems.Add(CStr(i + 20))
lvi.SubItems.Add(CStr(i + 30))
lvi.SubItems.Add(CStr(i + 10))
lvi.SubItems.Add(CStr(i + 20))
''''Me.userListView.Items.Add(lvi)
Next i
userListView.Columns.Add("aaa")
userListView.Columns.Add("bbb")
userListView.Columns.Add("ccc")
userListView.Columns.Add("ddd")
userListView.Columns.Add("eeee")
userListView.EndUpdate()
Knowing little is the worst thing . I am having trouble with this
code... I am beginner and this is not working for me at all...
I am simply trying to list my listview. I tried googling hours but end
up here.. .Please help... My listview is in detail mode. When i run
the following code, the listview becomes longer (vertical scroll pops
up) but there is nothing in the list, neither does the column header
shows up...
Dim userListView As ListView = Me.listViewUN
userListView.BeginUpdate()
userListView.Items.Clear()
For i As Integer = 0 To 9
Dim lvi As ListViewItem = userListView.Items.Add
(i.ToString)
lvi.Text = "Row " & i.ToString
lvi.SubItems.Add(CStr(i + 10))
lvi.SubItems.Add(CStr(i + 20))
lvi.SubItems.Add(CStr(i + 30))
lvi.SubItems.Add(CStr(i + 10))
lvi.SubItems.Add(CStr(i + 20))
''''Me.userListView.Items.Add(lvi)
Next i
userListView.Columns.Add("aaa")
userListView.Columns.Add("bbb")
userListView.Columns.Add("ccc")
userListView.Columns.Add("ddd")
userListView.Columns.Add("eeee")
userListView.EndUpdate()