不知道你的数据来源是什么?
我这有个类似的例子,供LZ参考哈:
给GridView1的某列(TextBox控件列)赋值TextBox tb_1;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
            tb_1 = ((TextBox)this.GridView1.Rows[i].FindControl("TextBoxItemScore"));            if (tb_1 != null)
            {
                tb_1.Text = "0";       
            }
}

解决方案 »

  1.   

    额...- -   就是我要绑定GridView 但是有一列是一个字符串数组.我要动态生成N个HyperLink,能不能实现?
      

  2.   

    不是要给他赋值,是要动态生成HyperLink,而这个HyperLink是要放在一个div里面.
      

  3.   

    1.先要在界面上将那一列的属性设置为HyperLink类型
     <tr>
                    <td >
                        <asp:GridView ID="GridView1" runat="server" 
                            AllowSorting="True" AutoGenerateColumns="False" OnRowDataBound="ColumnOper" 
                            CellPadding="1" CaptionAlign="Left">
                            <Columns>
                                <asp:BoundField DataField="Office_Name" HeaderText="科室名称" />
                                <asp:BoundField HeaderText="状态" />
                                <asp:BoundField HeaderText="考核日期" HtmlEncode="False" />
                                <asp:ButtonField HeaderText="操作" />
                                <asp:BoundField DataField="OfficeID" />
                                <asp:BoundField HeaderText="考核完成日期" />
                            </Columns>
                            <EmptyDataTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server" Width="97px">HyperLink</asp:HyperLink>
                            </EmptyDataTemplate>
                            <HeaderStyle CssClass="gridviewhead" />
                        </asp:GridView>
                    </td>
                </tr>2.写出事件函数,即可实现超链接功能了
     protected void  ColumnOper(object sender, GridViewRowEventArgs e)
       {
     if (e.Row.RowIndex != -1)
            {
     string WindowOpenString = "<a href='KPIDetails.aspx?KPIID=" + MykpiID"',target='_blank'>查看详情</a>";           
     e.Row.Cells[3].Text = WindowOpenString;//在新页面查看详情
    }
    }
      

  4.   

    <a href='KPIDetails.aspx?KPIID=" + MykpiID"',target='_blank'>查看详情 </a>";          用  <a>