Hi,
Add a new calculated column to your dataset. Use that column as the
displaymember in the listbox.
Dim dc As DataColumn
'
' Add a new column in clients table which
' is full name.
dc = New DataColumn("Name")
dc.DataType = System.Type.GetType("System.String")
dc.Expression = "LastName + ', ' + FirstName"
dsClient.Tables(0).Columns.Add(dc)
Ken
--------------------
"David Webster" <David
Webster@discussions.microsoft.com> wrote in message
news:702563FB-11E4-411B-B010-E87E201BE974@microsoft.com...
I have the following bit of code (which works fine):
Dim Customer As New CCustomer
mFrmOrder.lstCustID.DataSource =
Customer.getCustomers.Tables("data")
mFrmOrder.lstCustID.DisplayMember = "surname"
mFrmOrder.lstCustID.ValueMember = "custID"
mFrmOrder.lstCustID.Refresh()
mFrmOrder.lstCustID.ClearSelected()
Customer = Nothing
My customer dataset ("Customer.getCustomers.Tables("data")") has 8 columns ,
I have set the the "custID" column in my dataset to equal the valuemember
property of the listbox and the "surname" to equal the Display member
property.
However, I want to change the listbox to DISPLAY two columns so the
displaymember for column 1 will equal "firstName" and then the displaymember
for column2 will be "surname". The valuemember stays the same with
"custID".
How do I do this ?!?!.
All I now is that I need to add the code
"lstCustID.multicolumns = true" at the start of my code chunk...
Please advise,
Many thanks.