Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Cannot Update ComboBox Text Property

$
0
0

I have a form with ComboBoxes added with code and with the DropDownStyle = DropDown.  Items in the combobox are added via an arraylist whose parameters for the DisplayMember and ValueMember are defined by a class.  I run into a problem when trying to set the text of the combobox while iterating through the controls on the form:

case "System.Windows.Forms.ComboBox":
    ComboBox comboBox = (ComboBox)pnlEquipmentDetails.Controls[i];

. . .

comboBox.Text = "EXCITER";

Even though "EXCITER" is a member of the combobox list, the text of the combobox becomes "myNamespace.myFolder.myClass" where "myClass" is the class that defines the parameters for the arrayList and DataSource for the ComboBox.


Rob E.





Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>