Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
(DropDownList)location = (DropDownList)GridView1.FooterRow.FindControl("Location");
(TextBox)item = (TextBox)GridView1.FooterRow.FindControl("Item of Work");



When i execute the code above line showing error:Cannot convert type 'string' to 'System.Web.UI.WebControls.DropDownList'
Posted
Comments
hitech_s 29-Aug-11 8:21am    
verify location is your dropdownlist name or not?
koolprasad2003 29-Aug-11 8:35am    
have u declear location veriable as "new dropdownlist" ?

Do this:

C#
location = (DropDownList)(GridView1.FooterRow.FindControl("Location"));
item     = (TextBox)(GridView1.FooterRow.FindControl("Item of Work"));
 
Share this answer
 
DropDownList location = (DropDownList)(GridView1.FooterRow.FindControl("Location"));
TextBox item = (TextBox)(GridView1.FooterRow.FindControl("Item of Work"));
 
Share this answer
 

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