对GridView有疑问吗? [英] Question about GridView?

查看:98
本文介绍了对GridView有疑问吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net的gridview中无法访问图表控件

Cannot Access chart control inside gridview in asp.net

foreach (GridViewRow item in GridView1.Rows)
{
    //if (Page.IsPostBack == false)
    //{
    Label chartname = (Label)item.FindControl("Chart1");
}

推荐答案

检查FindControl("Chart1"),
字符串Chart1与Db列名相同...
Check That FindControl("Chart1"),
string Chart1 is same as the Db Column Name...


而不是上面的语句中的标签控件,而是使用图表控件来找到contrl

Instead of label control in the above statement ,,, use chart control to find the contrl

eg: Chart chartname = (Chart)item.FindControl("Chart1");


这篇关于对GridView有疑问吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆