GridView 的RowCreated和RowDataBound事件中,生成行的顺序为Header、DataRow...、Footer、Pager所以需要在事件处理方法中操作时,要先判断RowType(Header,DataRow,Footer,Pager)或者RowIndex(-1,0,其他)