Hi,
I like to add DisplayMember and ValueMember to combobox when Loading forms. Then with combobox_SelectedIndexChanged event select the DisplayMember but assign ValueMember to a textbox field. I can add and assign the DisplayMember, but I cannot do it with ValueMember. in Designer.cs part at initiation;
this.cmbViziteType.Items.AddRange(new object[] {
"desease",
"medication",
"control"});
in the form
private void cmbViziteType_SelectedIndexChanged(object sender, EventArgs e)
{
dfViziteType.Text = cmbViziteType.Text;
}
This works fine. But what I want is;
"desease","malaria",
"medication","aspirin",
"control","ktrl"});
first column being display member and secon valuemember. On SelectedIndexChanged I like to assign ValueMembers to the textbox when I select displaymember.
So how can I form Displaymember and valuemember pair properly and secondly how can I make the selection as described
I hope I made myself clear.
Thanks in advance
snky