我是.Net的新手。我使用w8ish来了解如何获取单元格的索引,就像访问GridView后获取行的行索引一样。
发布于 2011-09-20 19:11:26
通过获取对行的引用并遍历其单元格来访问单元格。
例如,假设您正在处理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
}
}
}https://stackoverflow.com/questions/7484072
复制相似问题