M
Mark Jerde
I'm not finding help in Google. VS .NET 2003.
I have a user control with a ComboBox. At runtime the ComboBox gets loaded
with a long list of strings. Since I have up to 40 controls on a form I'm
trying to figure out a way for all 40 combobox controls to share the same
list of items.
The ComboBox.Items property is read only so setting all 40 to the same
ObjectCollection won't work.
On a whim I made the combobox static in the UC:
private static System.Windows.Forms.ComboBox cboFields;
This "works" from a data standpoint, as Items.innerlist is the same (and
correct) in all 40 UCs after initializing the first one. But it doesn't
work from the UI standpoint. The ComboBox control doesn't like being shared
across multiple UCs.
Suggestions? Or is there no alternative to haviing the same Items in all 40
instances?
Thanks.
-- Mark
I have a user control with a ComboBox. At runtime the ComboBox gets loaded
with a long list of strings. Since I have up to 40 controls on a form I'm
trying to figure out a way for all 40 combobox controls to share the same
list of items.
The ComboBox.Items property is read only so setting all 40 to the same
ObjectCollection won't work.
On a whim I made the combobox static in the UC:
private static System.Windows.Forms.ComboBox cboFields;
This "works" from a data standpoint, as Items.innerlist is the same (and
correct) in all 40 UCs after initializing the first one. But it doesn't
work from the UI standpoint. The ComboBox control doesn't like being shared
across multiple UCs.
Suggestions? Or is there no alternative to haviing the same Items in all 40
instances?
Thanks.
-- Mark