在asp.net中单击GridView中的名称时如何显示图表 [英] How do I display a Graph when clicking on a Name in a GridView in asp .net

查看:75
本文介绍了在asp.net中单击GridView中的名称时如何显示图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨亲爱的,



有谁能告诉我如何用链接制作网格?即,我的要求是当我点击gridview中的名称时,应在gridview下显示图表。如果有人有意,请帮助我。



谢谢...

Hi Dear All,

Could anyone please tell me how to make a grid with Links? i.e, my requirement is when I click on a name in a gridview a graph should be displayed under the gridview. If anyone has idea please help me.

Thank You...

推荐答案

add LinkBut​​ton RowCommand 如下所示

add LinkButton with RowCommand like below
<asp:gridview autogeneratecolumns="false" runat="server" id="grdCustomPagging" onrowcommand="grdCustomPagging_RowCommand" >
   <columns>
     <asp:linkbutton runat="server" id="lnkView" commandargument='<%#Eval("DealId") %>'>
         CommandName="VIEW">View Deal</asp:linkbutton>
 </columns>
</asp:gridview>



in RowCommand 事件你可以加载下面的图形


in RowCommand event you can load the graph like below

protected void grdCustomPagging_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName == "VIEW")
    {
        LinkButton lnkView = (LinkButton)e.CommandSource;
        string dealId = lnkView.CommandArgument;
        // do something with CommandArgument value like loading graph 
    }
}





check 如何处理gridview内链接按钮的点击事件 [ ^ ]


嗨Subhash,我建议你学习基础知识在ASP.NET中使用GridView控件。以下链接可能会对您有所帮助:



GridView一体化 [ ^ ]



在ASP.NET Gridview中插入,更新,删除,作为SQL Server的DataSource,MS Access(mdb / accdb),XML和Framework为2.0 / 3.0 / 3.5 / 4.0(VS 2005/2008/2010) [ ^ ]



- DD
Hi Subhash, I would suggest you to learn basics of working with GridView control in ASP.NET. The following links might be helpful:

GridView all in one[^]

Insert, Update, Delete in ASP.NET Gridview, DataSource as SQL Server, MS Access (mdb/accdb), XML and Framework as 2.0 / 3.0 / 3.5 / 4.0 (VS 2005/2008/2010)[^]

- DD


有不同的方法可以做到这一点。首先,您可以使用 System.Drawing 动态生成某个位图中的图形。您可以将结果保存到文件中,或者在某个带有适当标题的ASP.NET页面中生成苍蝇的内容(例如image / png)。



另见:

http://en.wikipedia.org/wiki/Media_type [< a href =http://en.wikipedia.org/wiki/Media_typetarget =_ blanktitle =New Window> ^ ],

http://www.iana.org/assignments/media-types/media-types.xhtml [< a href =http://www.iana.org/assignments/media-types/media-types.xhtmltarget =_ blanktitle =New Window> ^ ]。



另一种方法是生成基于HTML5 Canvas显示图形的Javascript: http:// en。 wikipedia.org/wiki/HTML5_canvas [ ^ ]。



您将能够找到几个可用的用于生成Canvas图形和不同类型的动画和交互行为的框架。请看我过去的回答:如何制作一个asp.net中的绘图区域 [ ^ ]。



-SA
There are different ways to do it. First, you can generate the graph in some bitmap on the fly, using System.Drawing. You can save result in a file or generate just the content of the fly in some ASP.NET page with appropriate header (such as "image/png").

See also:
http://en.wikipedia.org/wiki/Media_type[^],
http://www.iana.org/assignments/media-types/media-types.xhtml[^].

Another approach could be generating Javascript showing graphics based on HTML5 Canvas: http://en.wikipedia.org/wiki/HTML5_canvas[^].

You will be able to find several available frameworks for generation of Canvas graphics and different kinds of animation and interactive behavior. Please see my past answer: how to make a drawing area in asp.net[^].

—SA


这篇关于在asp.net中单击GridView中的名称时如何显示图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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