且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在运行时向网格添加新行时数据消失

更新时间:2023-10-16 20:17:34

您必须编写SetPreviousData方法来解决此问题,因为在单击按钮时会发生自动回发,因此您之前选择的数据将消失.
You have to write SetPreviousData method to solve this issue, because on button click autopost back will happen so , the data which you selected before will go off.


我在这里使用了两个网格视图,例如A和B.
我显示的是用户网格视图A,而不是网格视图B.
我要做的是每当添加新行时,都将网格视图A的内容放到网格视图B中,当添加该行时,网格视图B的内容显示在A中.

这可能不是***的处理方法,但它可以工作.另外,我们正在使用EDMX从数据库中获取数据
I have used two grid views here, say A and B.
I am showing the user grid view A and not grid view B.
What I am doing is whenever I add a new row, I am putting the contents of grid view A to grid view B and when the row gets added, the contents of grid view B are shown in A.

This might not be the best method of doing things but it works. Also, we are using EDMX to get data from database