2011-09-20 236 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 
     } 

    } 

    }