S
Sam
Hi,
I don't know how to specify the display and value field for a combobox
when using AddRange to fill the combo.
Here is what I have so far:
-A function to build an array of object :
Dim returnData() As Object
Do While myReader.Read()
ReDim Preserve returnData(count)
Dim currentData As New DataRecord
currentData.Display = myReader.GetValue(0).ToString
If ValueField Then
currentData.Value = myReader.GetValue(1)
End If
returnData(count) = currentData
count += 1
Loop
Return returnData
_________________________________________________
-A function that calls the above and fills my combo
cboHeaderType.Items.AddRange(m_queries.GetGetIdentTypes())
__________________________________________________
The problem is that apparentely the display and value specified above
don't work and no value is selected in my combobox.
Can you help
Thx
Reply
I don't know how to specify the display and value field for a combobox
when using AddRange to fill the combo.
Here is what I have so far:
-A function to build an array of object :
Dim returnData() As Object
Do While myReader.Read()
ReDim Preserve returnData(count)
Dim currentData As New DataRecord
currentData.Display = myReader.GetValue(0).ToString
If ValueField Then
currentData.Value = myReader.GetValue(1)
End If
returnData(count) = currentData
count += 1
Loop
Return returnData
_________________________________________________
-A function that calls the above and fills my combo
cboHeaderType.Items.AddRange(m_queries.GetGetIdentTypes())
__________________________________________________
The problem is that apparentely the display and value specified above
don't work and no value is selected in my combobox.
Can you help
Thx
Reply