Jay1b Posted March 18, 2005 Posted March 18, 2005 I am using the the following to fill a listview. There are two i was hoping someone could please help me with. 1) For some reason the very top (1st) line is kept blank and the first row that is filled is the 2nd row. (I presume the listview starts at row 0, and this is the problem). How can i fill the 1st line please? 2) item.SubItems(0).Text = ("A" & i) I would like to create this using the same method as i do the rest of the columns, but it wont work. Row 0 problems again. For i As Integer = 1 To 100 Dim item As New ListViewItem item.SubItems(0).Text = ("A" & i) item.SubItems.Add("B" & i) item.SubItems.Add("C" & i) item.SubItems.Add("D" & i) item.SubItems.Add("E" & i) ListView1.Items.Add(item) Next i Thanks. Quote
stustarz Posted March 18, 2005 Posted March 18, 2005 'Start at 0 to populate the very first row For i As Integer = 0 To 100 'Set the items first column text Dim item As New ListViewItem("A" & i) 'Set the other columns item.SubItems.Add("B" & i) item.SubItems.Add("C" & i) item.SubItems.Add("D" & i) item.SubItems.Add("E" & i) ListView1.Items.Add(item) Next i Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.