I have a ComboBox and I want to bind a generic List to it. Can anyone see why the code below won\'t work? The binding source has data in it, but it won\'t fill the ComboBox
Here is a rather simple way that doesn't use BindingSource:
first, add the generic list of string, perhaps to a "consts/utils" class:
public static List Months = new List
{
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
};
And here's how you add those strings to a combo box:
comboBoxMonth.Items.AddRange(UsageRptConstsAndUtils.Months.ToArray