Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to re-bind the combobox?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
How to re-bind the combobox?
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01400729
Message ID:
01400729
Vues:
101
Hi everybody,

I have the simple problem - two related comboboxes. One to select Category and another to select items by Category. I can not get it to work - it seems to only work the first time.

Do you see where is my problem in this code?
#region Select Category 
        private void cboCategories_SelectedIndexChanged(object sender, EventArgs e)
        {
            string SelectedItem = this.cboCategories.Text.Trim();
            if (SelectedItem != "Select Category")
            {
                this._inventoryEntries = _inventoryBiz.GetInventoryDictionaryByCategory(SelectedItem);

                foreach (KeyValuePair<string, string> kvp in this._inventoryEntries)
                {
                    this._inventoryList.Add(kvp.Key);
                }
                this.cboItems.Enabled = true;
                this.cboItems.DataSource = this._inventoryList;
            }
            else
                this.cboItems.Enabled = false; 
        }

        #endregion
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform