Custom displaymember in comboBox

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
B

Bill Nguyen

How can I have the comboBox display valuemember in addition to the column
specified in displaymember?
For example, I want to display stationID 1999 (valuemember) and stationName
such as "1999 - Station 1999" .

Any help is greatly appreciated.

Thanks

Bill
 
hi Bill,
if you are fetching data from the database then u can do it in
Query itself. try this: "select ValueMember + ' - ' + displayMember as
DisMember,ValueMember from TableX"
 
Lucky,

No that is not the way, you can add an extra column in the datatable with an
expression, however most don't like that way.

Cor
 
hi Cor,
of course people wont go that way. do u know how much it costs to add
one column in the DB Table? and whats ths worng in using this Query.
can u tell me the flaws in this Query. coz i've done this in my project
and it is working fine. why not to get most out of the SQL when it is
providing.
i definatly would like to have your views on this dude.
 
Lucky,
of course people wont go that way. do u know how much it costs to add
one column in the DB Table? and whats ths worng in using this Query.
can u tell me the flaws in this Query. coz i've done this in my project
and it is working fine. why not to get most out of the SQL when it is
providing.
i definatly would like to have your views on this dude.

It cost this statemement

dt.columns.add("MyDisplayValue",Gettype(System.String),"First + Second")

Cor
 
I'm using Lucky's tip now since I need to get it done quickly but I would
like to use Cor's later on.
Thank you both!

Bill
 
Back
Top