datagridview里列可否实现超链接? 如题,我把一些网址显示在datagridview的一个列里,能不能实现在datagridview上直接点击某条网址直接就转到对应的网页上去? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以的.下面是一个简单例子.你可以改改.<ItemTemplate> <asp:linkbutton ID="Label1" runat="server" Text='<%# Bind("cardvaliddate") %>' ForeColor="#00C0C0" OnClientClick=<%# "parent.location.href='UpdateCardvalidDate.aspx?CardNo=" + Eval("PeoCurrCardNo") + "'" %>> </asp:linkbutton></ItemTemplate> 可以啊添加列的时候,把列设成DataGridViewLinkColumn类型就可以了 办法一:假如你的第二列为网址内容,在gridview的RowDataBound里这么写就可以了 if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[1].Text = "<a href='http://" + e.Row.Cells[1].Text + "' target='_blank'>" + e.Row.Cells[1].Text + "</a>";} 关于读取数据库的问题 带参数的WCF方法调用问题 什么异常 c# LISTBOX 索引超出范围 小问题大家帮忙解决一下 c# rdlc报表显示折线图 如何把数组中的空值去掉 winform实现文件上传功能 安装vs2003时出现挂起重启 .net 反编译服务 有没有做过C#开发VC404P(天敏视频采集卡)的程序的,来帮忙看看 100分求解Nant自动构建方法【代码提交到CVS服务器】
<asp:linkbutton ID="Label1" runat="server" Text='<%# Bind("cardvaliddate") %>' ForeColor="#00C0C0" OnClientClick=<%# "parent.location.href='UpdateCardvalidDate.aspx?CardNo=" + Eval("PeoCurrCardNo") + "'" %>>
</asp:linkbutton>
</ItemTemplate>
添加列的时候,把列设成DataGridViewLinkColumn类型就可以了
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Text = "<a href='http://" + e.Row.Cells[1].Text + "' target='_blank'>" + e.Row.Cells[1].Text + "</a>";
}