摘要:在使用DataGridView绑定数据源时,显示的表格都会自动多一行,因此该控件的RowCount属性或者dtGridView.Rows.Count属性的值是“数据源表格中行数+1”,所以很容易在循环使用DataGridView的数据时出错。比如:for(int i=0;i<dtGridView.RowCount;i++){ for(int j=0;j<dtGridView.ColumnCount;j++) { String []strs=dtGridView[j,i].Value.ToString(); //由于RowCount比实际的行数多一,所以当i=RowCount-1时,
阅读全文