for (int i = 0; i < gridView1.RowCount; i++) { int rowHandle = gridView1.GetVisibleRowHandle(i); if (gridView1.IsGroupRow(rowHandle)) { string text = gridView1.GetGroupRowDisplayText(rowHandle); //... } if (gridView1.IsDataRow(rowHandle)) { for (int c = 0; c < gridView1.VisibleColumns.Count; c++) { object v = gridView1.GetRowCellValue(rowHandle, gridView1.VisibleColumns[c]); //... } } }
提示:gridcontrol是个容器,可能包含多个view,所以你应该遍历的是gridview。
但是在dev中是没有这种写法的 GridView1.Rows[i].Cells[0],所以不知道具体的没行列如何表示?