新添加的行到DataGridView没有显示

时间:2022-09-17 14:36:18

I have a DataGridView that allows users to enter new information. Using subsonic I Save the new info to the database. And this works correctly. My problem is that after the Save is done the newly added row disappears from the grid. I tried to Reload the form, but I get the following error:

我有一个DataGridView,允许用户输入新信息。使用亚音速我将新信息保存到数据库。这工作正常。我的问题是,在完成保存后,新添加的行将从网格中消失。我试图重新加载表单,但我收到以下错误:

Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.

I don't think the issue is subsonic related. Does anyone know why the newly added row disappears?

我不认为这个问题与亚音速相关。有谁知道为什么新添加的行消失了?

Thanks

1 个解决方案

#1


The reason was that I broke the binding connection by using ".ToTable()"

原因是我使用“.ToTable()”打破了绑定连接

kek444 - thanks for the reply. Don't think that will help. I'm not using _CellEndEdit but instead using _RowValidating. I've also tried _RowLeave and others. I don't really want to reload the form - I just don't know why the newly entered values disapper when the row loses focus.

kek444 - 感谢您的回复。不要以为这会有所帮助。我没有使用_CellEndEdit,而是使用_RowValidating。我也试过_RowLeave和其他人。我真的不想重新加载表单 - 我只是不知道为什么新行输入的值会在行失去焦点时消失。

#1


The reason was that I broke the binding connection by using ".ToTable()"

原因是我使用“.ToTable()”打破了绑定连接

kek444 - thanks for the reply. Don't think that will help. I'm not using _CellEndEdit but instead using _RowValidating. I've also tried _RowLeave and others. I don't really want to reload the form - I just don't know why the newly entered values disapper when the row loses focus.

kek444 - 感谢您的回复。不要以为这会有所帮助。我没有使用_CellEndEdit,而是使用_RowValidating。我也试过_RowLeave和其他人。我真的不想重新加载表单 - 我只是不知道为什么新行输入的值会在行失去焦点时消失。