for (int i = 0; i < gridView1.RowCount; i++) { DataRowView row = (DataRowView)gridView1.GetRow(i); }
gridView1是GridControl中的控件。如果不理解,可以看下边的代码
for (int i = 0; i < gridControl1.Views[0].row; i++) { DataRowView row= (DataRowView)gridControl1.Views[0].GetRow(i); }
如果要取该行的某列的值:
string colValue=row.Row.ItemArray[1].ToString();//取第二列的值
时间: 2024-11-09 01:45:46