You can write your own class that takes the 2 parameters and override
ToString method. In this example, it is useless (I did it with string
because I do not know your data structure), but val1 and val2 may be in an
another type and this time, it would help you to do what you want.
class TableItem {
private string val1;
private string val2;
public TableItem(string val1, string val2) {
this.val1=val1;
this.val2=val2;
}
public override string ToString() {
return val1+" "+val2;
}
}
To add the value in you combobox, do like following :
comboBox1.Items.Add(new TableItem("first","second"));
comboBox1.Items.Add(new TableItem("third","fourth"));
comboBox1.Items.Add(new TableItem("fifth","sixth"));
Hope it helps,
Ludovic Soeur.
"Hanumanth Reddy" <an*******@discussions.microsoft.com> a écrit dans le
message de news:09****************************@phx.gbl...
Any one could help how to bind two table field values
into combobox display member property. I mean i have two
fields in a table. One is states description and another
is states codes.I want to add these two fields to
combobox display property.
Any body knows this solution, post it.