Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i display a selected item from a drop down list to a label.
Posted

Steps
-------
1. Take One Label (label1) and combobox (comboBox1).
2. In SelectedIndexChanged event of combobox write following code.
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    label1.Text = comboBox1.SelectedItem.ToString();
}

:)
 
Share this answer
 
Try:
For value selected:
myLabel.Text = myDropdown.SelectedValue;

For text selected:
myLabel.Text = myDropdown.SelectedText;


For Web, selected text:
myLabel.Text = myDropdown.SelectedItem.Text;
 
Share this answer
 
v2
Comments
chandrashekhar racharla 27-Oct-10 2:00am    
sandeep i tested this one bu not changed depending on select value
Sandeep Mewara 27-Oct-10 2:49am    
Use debugger! You are surely missing out something. Might be rebinding the dropdownlist before the event is raised.

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