AddRange and Combobox Display/Value Field

  • Thread starter Thread starter Sam
  • Start date Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top