Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Value based on valuemember or displaymember
posted

we load a Ultracombo from an xml file with all 50 U.S. states.  2 columns, abbreviation and full name.

               _dsLoad.ReadXml(Application.StartupPath + "\\XML\\States.xml");
                cboState.DataSource = _dsLoad.Tables[0];
                cboState.DisplayMember = "Abbr";
                cboState.ValueMember = "State";

because the data is imperfect, sometimes IN will come over and sometimes INDIANA will.

cboState.Value = "INDIANA" will be fine

cboState.Value ="IN" will not.

Is there a way to set the value based on the displaymember value?  I can read the string coming in and decide there if it's abbr or Name, then set the value or dsiplaymembervalue.