Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey,

 

I try to bind a datasource to my combobox. The datasource is an array of objects.

 

Then I set the cmb01.displaymember = "Propertyname1".

Till here everything works fine.

But then I will also set the valuemember like this :

cmb01.ValueMember = "PopertyName2".

 

At runtime I receive always following exception :

 

"Could not bind to new display member. Parametername is newdisplaymember"

 

 

What will this mean? And how I have to resolve it?

 

Tkx,

Jac

Posted

Suppose the name of your dataset is ds. Try this:

cmb01.DataSource = ds.Tables(0)
cmb01.DisplayMember = "PropertyName1"
cmb01.ValueMember = ds.Tables(0).Columns(0).ToString

Hope that helps.

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...