Combobox not showing items

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the mutliple form method that was displayed on MSDN showing how to
create a stack and have the forms once instanstiated remain in the stack so
that they need not be recreated for performance.
The problem that I have is that I have a 2 tabpages in a tabcontrol with
several comboboxes. These boxes are populated using SQL Server Ce and
ArrayLists. When interrogated the boxes all have the correct items in its
item array, but the values never show in the box. I can use a
MessageBox(ComboBox.Items[3].ToString()); and see the value that I expect.
Does anyone have any clues on how to get past this.
Thanks
Heath
 
I have written the small test (that contain 2 tab pages) for this issue
and it seems that everything is ok. This code snippet is written in the
load event of the form. combobox1 & combobox1 are placed in the separate
tabs:

ArrayList al = new ArrayList();
al.Add("Item1");
al.Add("Item2");

comboBox1.DataSource = al;

.... or provide us with more info to reproduce it.


Best regards,
Sergey Bogdanov
 
Thank you Sergey
I found that the sample uses a compile directive #NETCFDESIGN something. I
had inadvertently removed that somehow. This directive wrapped the
InitializeComponent method and caused the failure.

Sergey Bogdanov said:
I have written the small test (that contain 2 tab pages) for this issue
and it seems that everything is ok. This code snippet is written in the
load event of the form. combobox1 & combobox1 are placed in the separate
tabs:

ArrayList al = new ArrayList();
al.Add("Item1");
al.Add("Item2");

comboBox1.DataSource = al;

.... or provide us with more info to reproduce it.


Best regards,
Sergey Bogdanov

I am using the mutliple form method that was displayed on MSDN showing how to
create a stack and have the forms once instanstiated remain in the stack so
that they need not be recreated for performance.
The problem that I have is that I have a 2 tabpages in a tabcontrol with
several comboboxes. These boxes are populated using SQL Server Ce and
ArrayLists. When interrogated the boxes all have the correct items in its
item array, but the values never show in the box. I can use a
MessageBox(ComboBox.Items[3].ToString()); and see the value that I expect.
Does anyone have any clues on how to get past this.
Thanks
Heath
 
Back
Top