dashley
Well-known member
Hi. I'm used to working with listviews that have checkboxes.
I have the one below and I figured I just false the checkbox and have 2 col's of data displayed. Well I guess I figured wong. I can't seem to figure out how to make 2 simple col's display. I get the headers but nothing in the 1st col.
I want the link to show in col 1 and the description (desc) to display in col 2.
Thanks
dash
I have the one below and I figured I just false the checkbox and have 2 col's of data displayed. Well I guess I figured wong. I can't seem to figure out how to make 2 simple col's display. I get the headers but nothing in the 1st col.
I want the link to show in col 1 and the description (desc) to display in col 2.
Thanks
dash
VB.NET:
Dim cmdcodes As New SqlCeCommand
cmdcodes.CommandText = ("Select link, desc from spt_codes order by desc")
Dim itemis As String = Nothing
Dim conn As New SqlCeConnection(connstr)
cmdcodes.Connection = conn
conn.Open()
Dim drcodes As SqlCeDataReader = cmdcodes.ExecuteReader
Me.ListView1.Columns.Clear()
Me.ListView1.Items.Clear()
ListView1.CheckBoxes = False
ListView1.Activation = ItemActivation.TwoClick
ListView1.Columns.Add("Ck", 25, HorizontalAlignment.Left)
ListView1.Columns.Add("Items", 400, HorizontalAlignment.Left)
While drcodes.Read
Dim lvi As New Windows.Forms.ListViewItem
itemis = drcodes(1)
lvi.SubItems.Add(itemis)
Me.ListView1.Items.Add(lvi)
End While
ListView1.View = View.Details