How to bind multiple columns from a DataTable to a Combobox
Posted on 2008-11-10
Okay guys, all the comboboxes I've done to this point have had one column from the datatable as the ValueMember and the DisplayMember.
I'm now working on a projectt where I need to display multiple columns from the DataTable in the combobox dropdown list.
I'm thinking my Value Member will still be my primary key from the table to follow their keystrokes if they begin to type in the combobox and my DisplayMember would be column1, column2, column3, but I've having issues getting this to work.
sql = "select Job, Customer_PO, Part_Number from Job"
da.SelectCommand = New Odbc.OdbcCommand(sql,dc)
cboJobData.DataSource = tblJob
cboJob.ValueMember = ??
dboJob.DisplayMember = ??