I only use a datasource and displaymember (and usually valuemember) if I
want the drop down list portion of the combo box to be populated from a
database, but that is not what I am doing in this instance at all so all
three of those are set to nothing.
As I have said, my drop down list is populated by way of the Items
collection in the VB.NET IDE. I just typed in the four possible allowed
values there. Under the databindings properties I have the text property
bound to my field in the database.
Here is the generated code from the form designer:
'cmbPartner
Me.cmbPartner.A nchor = CType(((System. Windows.Forms.A nchorStyles.Bot tom Or
System.Windows. Forms.AnchorSty les.Left) _Or
System.Windows. Forms.AnchorSty les.Right), System.Windows. Forms.AnchorSty les)
Me.cmbPartner.D ataBindings.Add (New System.Windows. Forms.Binding(" Text",
Me.datasetLocSc enario, "Scenario_to_Lo cation.PartnerT ype"))
Me.cmbPartner.I temHeight = 13
Me.cmbPartner.I tems.AddRange(N ew Object() {"", "Customer", "Supplier",
"Lead"})
Me.cmbPartner.L ocation = New System.Drawing. Point(568, 302)
Me.cmbPartner.N ame = "cmbPartner "
Me.cmbPartner.S ize = New System.Drawing. Size(176, 21)
Me.cmbPartner.T abIndex = 52
Gary
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:u0******** *****@TK2MSFTNG P09.phx.gbl...
Gary,
Can you show how you bind them, just one is enough.
I ask you this because you are so definitly talking about binding while
the normal way is to set the datasource of the combobox to the table of the
dataset and than tell which displaymember (datafield) will be used.
When you do that and you use the index_change event from the comboboxes.
Than do you have to protect that it is firing in advance. The most used
method is a startupswitch (bool), which is set to true as soon as the
datasource and members of the comboboxes are set.
I hope this helps?
Cor