haezeban Posted February 11, 2004 Posted February 11, 2004 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 Quote
Spiel79 Posted February 13, 2004 Posted February 13, 2004 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. Quote
haezeban Posted February 13, 2004 Author Posted February 13, 2004 Spiel, I found if the second property wasn't a property but a field. So, I changed it to a property and now it works. Thx Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.