datagrid属性-属性生成器-列-超链接列
解决方案 »
- aspnetPager
- webservice怎样接收json类型的参数
- 问一个关于Server.Execute()的调试问题
- dropdownlist的数据绑定了。但没有达到我要的效果。我要第一条显示:“请选择”
- 我发现.net的标准web控件还是很弱的
- 用HttpWebRequest和HttpWebResponse做客户端程序时怎样在服务器上引发事件!!急! 有高分!!!
- .net中的一些数据控件直接拖上去用好还是用编程定义好?
- 为大家提供技术学习资料上传空间
- 关于DATAGRID删除问题!急!急!
- ASP.NET 中cache问题;
- Asp.net中连接Access数据库出错--C#代码
- 请问如何判断用户上传的是否dbf格式的文件?
<columns>
<hyperlinkcolumns>
你可以根據你item(index)的值判斷你具體要哪一組item為超連接
在private void DataGrid_ItemDataBound()事件中:
if(e.Item.ItemIndex!=-1)
{
//首先是判断条件:
if(DataGrid2.DataKeys[e.Item.ItemIndex].Equals("1")) {
foreach(Control imag in e.Item.Cells[1].Controls)
{
if(lable.ID=="你的普通列名")
{
lable.Text="<a herf='1.aspx'>文本</a>";
}
}
}
else
{
lable.Text="文本"
}
http://chs.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/datagrid/doc_datagrid.aspx