如何遍历gridview的每行和每列?
------解决方案--------------------------------------------------------
- C# code
foreach (GridViewRow gvr in GridView1.Rows) { foreach (TableCell gvCell in gvr.Cells) { //gvCell就是你想要的列了 } }
foreach (GridViewRow gvr in GridView1.Rows) { foreach (TableCell gvCell in gvr.Cells) { //gvCell就是你想要的列了 } }