void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
var firstCell = e.Row.Cells[0];
firstCell.Controls.Clear();
firstCell.Controls.Add(new HyperLink { NavigateUrl = firstCell.Text, Text = firstCell.Text });
}
}
Run Code Online (Sandbox Code Playgroud)
请注意,如果仅在第一次加载页面时将数据绑定到网格,则更改将消失.