I have a situation whereby my form loads and populates comboBox1 which works fine. However, when the user selects a value from comboBox1 I want to populate comboBox2 with values based on the selection but can't seem to get it to work:
Here is my event handler for the first comboBox.
private void comboBoxTargetProduct_SelectedIndexChanged(object sender, System.EventArgs e)
{
string product = comboBoxTargetProduct.SelectedText.ToString();
switch(product)
{
case "Product1":
{
comboBoxExtensionType.DataSource = Enum.GetNames(typeof(CreativeNRG.ProductType));
this.Refresh();
break;
}
}
}
If it was a web based form then I would simply call the DataBind method but this does not appear to be available in the windows forms environment.
Thanks in advance for your help.
Simon

Binding CompboBox after form has loaded
Steven Hemingray - MSFT
Allighator
to triggerit maybe you need to set datasource to nothing and then to this array.
Try that.
Drew Speedie
dehran ph
Are you sure there are values getting populated
bewA
Just so I know, can you explain why I need to set the datasource to null first
Thanks again.
Simon
mjcs100
comboBoxExtensionType.DataSource = Enum.GetNames(typeof(CreativeNRG.ProductType));
However, I know little about what this display member property does, what value would I set it to
Thanks for your help.
Simon
dr.thomas