Click here to Skip to main content
14,449,431 members
Rate this:
Please Sign up or sign in to vote.
See more:
i have list of course in the listbox.

i have one button called Add Course

Then i have one dropdownlist.

which course i select in the listbox, then i click the Add course, that selected course to be added in the dropdownlist.


for that how can i do using csharp.


Rgds,
Narasiman P
Posted
Comments
[no name] 26-Jul-13 21:47pm
   
www.whathaveyoutried.com
Jameel VM 27-Jul-13 1:49am
   
why you are wasting your valuable time? ask to Google. he will help you.
Rate this:
Please Sign up or sign in to vote.

Solution 1

I'm sorry to say but for me this is just to basic not to know.

But here this should be what you want.

private void button1_Click(object sender, EventArgs e)
       {
           listBox1.Items.Add(comboBox1.SelectedItem.ToString());
       }
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

private void addcourse_Click(object sender, EventArgs e)
       {
string text = listBox1.GetItemText(listBox1.SelectedItem);
dropdownid.Items.Add(text);
}
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100