2011-09-20 292 views

回答

0

通过获取对该行的引用并遍历其单元格来访问单元格。

说,例如,你正在处理的RowDataBound事件,你这是怎么进入细胞:

protected void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e) 
    { 

    if(e.Row.RowType == DataControlRowType.DataRow) 
    { 

     //e.Row.RowIndex will tell you the current row index 
     foreach (TableCell cell in e.Row.Cells) 
     { 
      //do something with the cell 
     } 

    } 

    }