Hi there.
I've got an xml file that i'm trying to bind to a combo box. i'm trying to save the selected value of the combo to another text box.
when my form initially loads, the text box shows System.Data.DataRowView
instead of the currently selected value.
i've read on other posts that this can happen if you don't have the right column names specified. but i'm pretty sure that's not my problem... because i'm not using string values for names, but referencing them by index. also, the actual combo boxes do display the list of values...
Here's the code to bind the xml data:
With Me.cmboSectionAQ1
.DataSource = dsYNDNK.Tables(0)
.DisplayMember = dsYNDNK.Tables(0).Columns(0).ColumnName
.ValueMember = dsYNDNK.Tables(0).Columns(1).ColumnName
End With
and the code to save / show the currently selected value in a separate text box:
Private Sub cmboSectionAQ1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmboSectionAQ1.SelectedIndexChanged
SelectedValueTextBox.Text = cmboSectionAQ1.SelectedValue.ToString
End Sub
It's in the selectedvaluetextbox that the system is showing "system.data.datarowview"
Any suggestions?
Thanks.
I've got an xml file that i'm trying to bind to a combo box. i'm trying to save the selected value of the combo to another text box.
when my form initially loads, the text box shows System.Data.DataRowView
instead of the currently selected value.
i've read on other posts that this can happen if you don't have the right column names specified. but i'm pretty sure that's not my problem... because i'm not using string values for names, but referencing them by index. also, the actual combo boxes do display the list of values...
Here's the code to bind the xml data:
With Me.cmboSectionAQ1
.DataSource = dsYNDNK.Tables(0)
.DisplayMember = dsYNDNK.Tables(0).Columns(0).ColumnName
.ValueMember = dsYNDNK.Tables(0).Columns(1).ColumnName
End With
and the code to save / show the currently selected value in a separate text box:
Private Sub cmboSectionAQ1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmboSectionAQ1.SelectedIndexChanged
SelectedValueTextBox.Text = cmboSectionAQ1.SelectedValue.ToString
End Sub
It's in the selectedvaluetextbox that the system is showing "system.data.datarowview"
Any suggestions?
Thanks.