Populated Label control inside gridview from outside dropdownlist.

I have a gridview and inside in one column of it a Label control. Also i have a dropdownlist control out of the gridview. I want the selected item in dropdownlist to be appearred in the label inside the gridview.

Any Help would be great!
nikavakAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Salim FayadConnect With a Mentor Commented:
It would be better to once an item is selected from the dropdownlist, to save this value into the database and then to bind the gridview to the database. This way, your value will be there.
But if you don't want to save it into the database, you can access the label as following:

((Label)(GridView1.Rows[0].FindControl("YourLabel"))).Text = DropDownList.SelectedItem.Text;

Open in new window

0
All Courses

From novice to tech pro — start learning today.