I am binding combobox with datasource, displaymember, valuemember. It is working fine in my computer but it is not working in clients pc. Following is my source code:
<
This definitely happens if your cbxMetal_SelectedIndexChanged
is called before cbxAlloyBinding()
is called in your constructor.
For instance (see the code below), you may have other combobox bindings in constructor which may come before cbxAlloyBinding()
in constructor, and those bindings are calling cbxMetal_SelectedIndexChanged
.
public Constructor()
{
InitializeComponent();
cbxheatBinding(); //1st Three Binding Methods may be somehow related to your cbxMetal,
dtpStartDateBinding(); //which leads them to call cbxMetal_SelectedIndexChanged method.
dtpEndDateBinding();
cbxAlloyBinding();
}
What I suspect is your cbxMetal.DataSource
is set from some other point in your code and well before DisplayMember
and ValueMember
are assigned;
Just remember, System.DataRow.DataRowView
will occur only if
ComboBox.SelectedValue
is called beforeValueMember
assignment.