Easy_Rider9999
New member
- Joined
- Feb 13, 2009
- Messages
- 2
I want to set the DataSource Property of a listview and of a combobox to an array of datarows.
This is the Code:
The Name column does exist but the ComboBox shows only the type of each datarow not the contents! If I set the datasource to a datatable, the correct column is shown in the combobox/listview.
Many Greetings
Hans
This is the Code:
Code:
Private Sub fillCBKoerperTeile() (ByVal FilterExpression As String, ByVal Sort As String)
Dim rows() As Data.DataRow
Dim dr As Data.DataRow
Try
rows = dtKoerperTeile.Select(FilterExpression, Sort)
cbKoerperTeile.DataSource = rows
cbKoerperTeile.ValueMember = "Name"
cbKoerperTeile.DisplayMember = cbKoerperTeile.ValueMember
Catch e As Exception
Throw New ApplicationException(CodeLoc & " Error!", e)
Finally
dr = Nothing
End Try
End Sub
The Name column does exist but the ComboBox shows only the type of each datarow not the contents! If I set the datasource to a datatable, the correct column is shown in the combobox/listview.
Many Greetings
Hans