两种方式:
//第一种 Grid.Columns.FromKey("filename").Type = ColumnType.HyperLink; protected void Grid_InitializeRow(object sender, RowEventArgs e) { e.Row.Cells[10].TargetUrl = ...... } //第二种 protected void Grid_InitializeRow(object sender, RowEventArgs e) { e.Row.Cells[10].Value = (String.IsNullOrEmpty(e.Row.Cells[10].Text)) ? null : "<a href='" + fullpath + "'target='_blank' >" + e.Row.Cells[10].Text + "</a>"; }
本文介绍两种在网格视图(Grid)中实现单元格内容作为超链接的方法。第一种方法通过设置列类型为超链接并指定目标URL;第二种方法则是直接修改单元格的值,插入带有超链接的HTML代码。
1480

被折叠的 条评论
为什么被折叠?



