Datasource - Databinding

Hello

I got an issue regarding a combobox.
I'll add the code :

With Me.cboSourceFolder
.DataSource = GetVersions()
.ValueMember =
"ID"
.DisplayMember = "Value"
'.SelectedIndex = 0
End With

With Me.cboSourceFolder2
.DataSource = GetVersions()
.ValueMember =
"ID"
.DisplayMember = "Value"
'.SelectedIndex = 0
End With

System.Windows.Forms.Application.DoEvents()

Result :

cboSourceFolder.Text "20060608_2300" String
cboSourceFolder2.Text "System.Data.DataRowView" String

Any idea what's the reason for this
Must be said that the second combobox is on another page of my tabcontrol. I don't know whether this has something to do with it.
Another thing : when I put cboSourceFolder2 in the watch (after setting the datasource), this happens :

cboSourceFolder2.Text "20060608_2300" String

It must have something to do with the binding, but I don't know exactly what.

Any ideas

Regards
Reinout




Answer this question

Datasource - Databinding

  • Brett Selleck

    Could you provide any details on what getversions is doing.

    Is it returning a dataset and if so what is the format of this dataset.


  • Haider Naqvi

    The function returns a default dataview, based on a datatable containing 2 columns.

    The function is working correct, since it works for combobox 1 and for combobox 2 as well if I attach the datasource after activating the tab containing this combobox. (So it's a page containing a tab control with 2 tabpages, combobox 1 is on tab page 1, combobox 2 is on tab page 2.)
    At first, I did put this code in the page_load, which was failing as you saw in my opening post.

    I was wondering about the behaviour of the combobox so I still like to know what's the reason it failed.



  • Datasource - Databinding