H
H2Os
Hi
I have a ListView control into which I am adding a number of items with
additional data held in subitems. With the ListView, you cannot have
subitems without column headers so I am adding these also.
For View styles of LargeIcons, SmallIcons and Details, everything is OK -
but for List style no items are displayed.
If I remove the column headers, everything is fine except that I cannot
store the additional information.
Does anybody have any ideas or suggestions to how I can fix this?
I'm using VS.2003, CF 1.0 SP3
---Snippet---
Me.lstProducts = New System.Windows.Forms.ListView
Me.lstProducts.View = View.List
Me.lstProducts.Columns.Add("Product", -1, HorizontalAlignment.Left)
Me.lstProducts.Columns.Add("ID", 0, HorizontalAlignment.Left)
Me.Controls.Add(Me.lstProducts)
Me.general_lstProducts.Items.Clear()
lookup_dt = {DataTable}
For Each dr In lookup_dt.Select
li = New ListViewItem(dr("Description").ToString)
li.SubItems.Add(dr("ID").ToString)
Me.general_lstProducts.Items.Add(li)
li = Nothing
Next dr
Thanks in advance
I have a ListView control into which I am adding a number of items with
additional data held in subitems. With the ListView, you cannot have
subitems without column headers so I am adding these also.
For View styles of LargeIcons, SmallIcons and Details, everything is OK -
but for List style no items are displayed.
If I remove the column headers, everything is fine except that I cannot
store the additional information.
Does anybody have any ideas or suggestions to how I can fix this?
I'm using VS.2003, CF 1.0 SP3
---Snippet---
Me.lstProducts = New System.Windows.Forms.ListView
Me.lstProducts.View = View.List
Me.lstProducts.Columns.Add("Product", -1, HorizontalAlignment.Left)
Me.lstProducts.Columns.Add("ID", 0, HorizontalAlignment.Left)
Me.Controls.Add(Me.lstProducts)
Me.general_lstProducts.Items.Clear()
lookup_dt = {DataTable}
For Each dr In lookup_dt.Select
li = New ListViewItem(dr("Description").ToString)
li.SubItems.Add(dr("ID").ToString)
Me.general_lstProducts.Items.Add(li)
li = Nothing
Next dr
Thanks in advance