【发布时间】:2015-11-19 13:28:02
【问题描述】:
我将列动态添加到网格视图中:
foreach (Countries country in CountryLst )
{
TemplateField templatefield = new TemplateField();
tfield.HeaderText = "Header" + country;
gridview1.Columns.Add(templatefield);
}
现在我想将这些列标题设为Hyperlink,如何使用Hyperlink 实现相同的效果
【问题讨论】:
-
参考这个stackoverflow.com/questions/13288215/… 和这个stackoverflow.com/questions/1819381/… 进行一些小的改动,它们会为你工作
-
我已经看到了,但它们没有显示为
hyperlink按钮 -
不显示为超链接按钮是什么意思?如果你想要按钮,那么你应该使用
LinkButton,因为Hyperlink将呈现为<a />
标签: c# asp.net gridview hyperlink