Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a combobox(Itemtype) that lets the user select 1 of 3 values. Depending on what they select I need to change the datasource and valuemenu of another combobox.

 

simple I thought.

when I run the code it works OK if you select(1,2, or3 ) it fills the other combo box with the correct data. However if I then change the value in Itemtype I get an error message:

Unhandled Exception: System.ArgumentException: Could not bind to the new value member.

Parameter name: value

 

Any ideas????

 

Private Sub cboItemType_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboItemType.SelectionChangeCommitted

 

If cboItemType.SelectedValue = 1 Then 'comp

cboItemId.Visible = True

cboItemId.DataSource = DsOrdertwo1

cboItemId.ValueMember = "viewstock.ecas"

 

ElseIf cboItemType.SelectedValue = 2 Then 'kit

cboItemId.Visible = True

cboItemId.DataSource = DsOrdertwo1

cboItemId.ValueMember = "viewkits.kitid"

Else

cboItemId.Visible = True

cboItemId.DataSource = DsOrdertwo1

cboItemId.ValueMember = "viewmodules.modid"

End If

 

 

Thanks In advance

Posted

Didn't work. Got the same err message.

Seems to be the valuemember bit it does not like.

Also tried puting that line of code IN the if statement.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...