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

ComboBox Items Not Showing On Dropdown

$
0
0

Hi All,

 

I am inheriting a windows form and modifying it in C#.  The parent form has three ComboBoxes and all are populated pragmatically to fit the user’s options.  In the parent form, the ComboBox Items are populating fine and there are no problems at runtime.  Yet, in the child form, none of the ComboBox items will show during runtime on Dropdown event.  Both are being set using the same algorithm, the only difference is the child form ComboBoxes are set in the child form constructor, and the parent form ComboBoxes are set in a sequence based on which items the user selects after the form loads.  Here is a sample of how the combo boxes are set in the child form:

 

Code Block

privatevoid setComboBoxes()

{

cbMake.BeginUpdate();

foreach (Make mk in makers.ToArray())

cbMake.Items.Add(mk.Name);

cbMake.EndUpdate();

 

cbModel.BeginUpdate();

foreach (Model mdl in make.Models)

cbModel.Items.Add(mdl.Name);

cbModel.EndUpdate();

 

cbItems.BeginUpdate();

foreach (IOrderItem itm in model.Equipment)

cbItems.Items.Add(itm.Name);

cbItems.EndUpdate();

}

 

 

I have stepped through the code on the child form and all of the items appear in the ComboBox.Items.InnerList collection as they should.  But at runtime, when the user clicks the down arrow to dropdown the items list, no items show. 

 

Any advice offered would be much appreciated.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



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