日期:2014-05-17 浏览次数:20429 次
GridView1.DataSource = Enumerable.Range(0, 10); GridView1.DataBind(); HyperLink link = GridView1.Rows[3].Cells[0].Controls[0] as HyperLink; link.NavigateUrl = null;
------解决方案--------------------
<asp:TemplateField HeaderText="Header" SortExpression="Field">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" navigateUrl='http://www.google.com' Text='Google'
Visible='<%# GetShowLink(Eval("flagShowLink"))%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
public bool GetShowLink(object o)
{
//判断true,false