winForm 下的DG没有Rows\Items属性,但好像有DataGridRows这个属性可是好像不能用呀,我用的下面方法:
用一下强制转换 DataTable dt = (DataTable)DataGrid1.DataSource;
int row = dt.Row.Count;