Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Cannot Access chart control inside gridview in asp.net
C#
foreach (GridViewRow item in GridView1.Rows)
{
    //if (Page.IsPostBack == false)
    //{
    Label chartname = (Label)item.FindControl("Chart1");
}
Posted
Updated 1-Jun-12 10:13am
v2
Comments
R. Giskard Reventlov 1-Jun-12 17:06pm    
and? We need a little more than that.

Check That FindControl("Chart1"),
string Chart1 is same as the Db Column Name...
 
Share this answer
 
Instead of label control in the above statement ,,, use chart control to find the contrl

C#
eg: Chart chartname = (Chart)item.FindControl("Chart1");
 
Share this answer
 
v2
Comments
Member 8911636 2-Jun-12 9:30am    
but here is not access "Chart" . ..
what's it's reason...??
akshay k 2 3-Jun-12 1:39am    
if you are using vs2008 then u will have to download the dll for chart from microsoft website or if u r using vs 2010 u will get chart automatically

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