HyperLink l=(HyperLink)daGrid1.Items[i].Cells[4].Controls[5];中的Controls[5]; 不明白什么意思!!!

解决方案 »

  1.   

    你那daGrid1没有那么多列.
    该是daGrid1.Items[i].Cells[3]吧
    这是从0开始数的.值为3的是第四列
      

  2.   

    Items[i].Cells[4].Controls[5];
    中的i,4,5都有可能超出了下标。察看一下是否有那么多的元素。注意,重0开始计算。
      

  3.   

    HyperLink l=(HyperLink)daGrid1.Items[i].Cells[4].Controls[5]
    Items[i].Cells[4]中有这么多控件吗?一个的话如下
    HyperLink l=(HyperLink)daGrid1.Items[i].Cells[4].Controls[0]
      

  4.   

    不要用Controls[5],还是用FindControl("ControlName")吧
      

  5.   

    看看
    用FindControl("ControlName")
      

  6.   

    agree above  Cells[4].Controls[5]  has error
      

  7.   

    c#的DataGrid的行列序号从0开始!
      

  8.   

    同意楼上的。可能是你的 daGrid1.Items[i].Cells[4].Controls[5] 下标超出了。
      

  9.   

    agree above  Cells[4].Controls[5]  has error肯定出错  我试了Controls[0]   注意有摸板列  Controls[0] 和摸板列有关!!!