0

我有一个从记录集中填充的 datagridview(dgv)。

dgvMatchErrors.DataSource = dsTest.Tables[0];
messagebox.show(dgvMatcherrors.rows) (shows 20)

好的,没问题,但是当我重新填充 DGV 时,我执行以下操作

dgvMatchErrors = new DataGridView();
dgvMatchErrors.DataSource = null;
dgvMatchErrors.Rows.Clear();
dgvMatchErrors.Refresh();

运行查询以再次填充它

dgvMatchErrors.DataSource = dsTest.Tables[0];
messagebox.show(dgvMatcherrors.rows) (shows 0

) 但数据仍在网格中但没有行。???????????????

4

0 回答 0