Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
have database. I fill one comboBox1 from the database. What if I choose to ComboBox2 comboBox1 data associated with comboBox1 come in? Can you help please??
Posted

1 solution

create a class to save a value and value associated with it.. and you can retrieve it later.

C#
class ComboItem
       {
           public string Name;
           public int ID;
           public ComboItem(string Name, int value)
           {
               this.Name = Name;
               this.ID = value;
           }
           public override string ToString()
           {
               return this.Name;
           }
       }
 
Share this answer
 
Comments
partsada 19-Mar-14 8:16am    
Thank you. created a lot of my work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900