This is a migrated thread and some comments may be shown as answers.

[Solved] Text in comBobox

0 Answers 93 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
chan
Top achievements
Rank 1
chan asked on 14 Aug 2009, 03:50 AM
HI
There are a couple of comBobox named comBobox1 and comBobox2, and there is a SelectIndexChanged event for comBobox1.when this event fired,value (text as well) in  comBobox2 shloud be changed as value in comBobox1 was changed. Here i get a problem,when the event occured,text in comBobox2 always the old one(even if it did not exist in the new datasourse),it did not refresh, and i need to delete the old text manually.
Is there any way to resolve it? Following is the demo
 protected void ddlMfg_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        int mfg; 
        if (int.TryParse(this.ddlMfg.SelectedValue, out mfg)) 
        { 
            this.ddlBrandedLabel.Items.Clear(); 
            this.ddlBrandedLabel.DataSource = ProductStatus.ProductBrandedLabel_SelectAll_ByMfgId_AsDataSet(mfg, 0, 9); 
            this.ddlBrandedLabel.DataBind(); 
        } 
        else 
        { 
            ddlBrandedLabel.Items.Clear(); 
        } 
    } 
 

Best regards

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
chan
Top achievements
Rank 1
Share this question
or