DataSet.acceptchange problem

zhaozj2021-02-16  68

There is a function in the project, add / delete / modify data directly in the Grid, you want to keep these operations like Outlook, you can keep the current Group's Expand and Collapse status.

In the actual process, you have never been able to keep the current state. Every time you add new DataRow, you will expand all Group.

Later, the problem was discovered in DataSet.Acceptchanges (), because after Dataset.AcceptChanges () or MERGE (), DataSet notifies all DataView changes, DataView will notify the binding control. The data binding control recalculates the data, so the previous Group status will be lost. So just change to each updated ROW to do DATAROW.ACCEPTCHANGES (), there will be no problem, and the GROUP state is not lost.

转载请注明原文地址:https://www.9cbs.com/read-17716.html

New Post(0)