how about e.Item.Cells(1).Controls(0)? or e.Item.Cells(1).FindControl("YourControlID")?

解决方案 »

  1.   

    同意 saucer(思归, MS .NET MVP) 
    默认编号一般都是从0开始。
    最好用e.Item.Cells(1).FindControl("YourControlID")省得麻烦
      

  2.   

    FindControl的好处更在于不必考虑aspx解析器的行为。
    模板列经常在前面生成一个Literal的..那么想需要得到的控件的索引比较难直接判断出.
      

  3.   

    e.Item.Cells(1).Controls(0) 或者 
    e.Item.Cells(1).FindControl("YourControlName")?
      

  4.   

    saucer(思归, MS .NET MVP) 说的没错
      

  5.   

    对不起,是我没搞清e.item.itemtype加上判断只对数据项操作以后,好了。谢谢!