想在数据列表的ItemCommand中使用Chart控件 [英] want to use Chart control at ItemCommand of data list

查看:57
本文介绍了想在数据列表的ItemCommand中使用Chart控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datalist,我在数据列表的itemcommand使用show many controls

像这样:



i have a datalist and i use show many controls at itemcommand of data list
like this:

protected void DataList4_ItemCommand(object source, DataListCommandEventArgs e)
   {

       RadioButton rd5 = (RadioButton)e.Item.FindControl("RadioButton5");
}







现在我的问题是我想在itemCommend使用Chart contol,



是这样的:




Now My problem is I want to use Chart contol at itemCommend,

like this:

Chart1.DataSource = dt;

Chart1.DataBind();





我试试这个:

chart chart1 =(图表)e.Item.FindControl(chartshow);



它也不支持项目推荐,



所以PLZ帮助我,我怎么能在itemcommend上使用图表控件,



你还可以在gridView_RowCommand为我提供解决方案,如果可能的话



And I am try this:
chart chart1 = (chart)e.Item.FindControl("chartshow");

it also not support at item commend,

so plz help me, how can i use chart control at itemcommend,

you also provide solution to me at gridView_RowCommand if possiable

推荐答案

我找到了解决方案它非常简单:



只需将命名空间添加到页面顶部即可获得itemdatabound的图表控件:



I found The solution Its very easy:

just add namespace to top of page and you will get chart control at itemdatabound:

System.Web.UI.DataVisualization.Charting


这篇关于想在数据列表的ItemCommand中使用Chart控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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