
Problem with selecting row in a listView
Hi,
i've a little problem selecting row in a listView. I've fill this
ListView with data from a Excel File. Here's the code :
Dim xlWorkSheet As Excel.Worksheet
xlApp = New Excel.Application()
obooks = xlApp.Application.Workbooks
'Ouverture du fichier
xlbook = obooks.Open(Application.StartupPath & "\DoBeeps.xls")
xlsheet = xlbook.Worksheets
xlWorkSheet = xlsheet.Item(1)
'Lecture des cellules du fichier excel et criture dans le
ListView
Dim i As Integer
For i = 3 To 7
Dim item1 As New ListViewItem()
item1.SubItems.Clear()
item1.SubItems.Add(xlWorkSheet.Cells(i, 1).Text)
item1.SubItems.Add(xlWorkSheet.Cells(i, 2).Text)
ListView1.Items.Add(item1)
Next
The problem : the ListView shows correctly the data but i can't select
a row clicking with the mouse... If i create a listView with Items I
entered myself, it works...
Do I make a mistake filling the ListView ?
Can you help me ?
Thanks a lot
Steve