我的UltraGrid
项目中有一个,并且我在表单上有一个更新功能来更新数据匹配的数据库中的数据。
网格中的数据存储为DataTable
. 如果从 中删除一行现有数据UltraGrid
,我希望能够将 中RowState
的该行设置DataTable
为“RowState.Deleted , so that in the Update function I can check the
RowState”,如果它是已删除的行,则将其删除,否则,更新数据。
我该怎么做呢?到目前为止,我有下面的代码,但是返回的行数是 1(或者,网格中的当前行数)而不是 2(我删除一行之前的行数)。
在代码中如何以及在何处RowState
将已删除行的 设置为RowState.Deleted
?有没有使用的替代方法UltraGrid
?
dsProducts.Tables.Add(commDt.Copy) -- commDt is the DataTable linked to the UltraGrid
tr = con.BeginTransaction(
For Each dr As DataRow In dsProducts.Tables(0).Rows
If dr.RowState = DataRowState.Deleted Then
Try