Set RowState to deleted in DataTable when deleting UltraGridRow
New DiscussionTo keep things simple, let’s say I have a DataSet that I declared at the top of the class (in vb.net), called testDT, and a DataSet called testDS.
In the BeforeRowsDeleted method, I’ve got my own MsgBox confirming that the user does wish to delete the relevant row. Before this MsgBox, I’m calling the following code; testDt = ugComm.DataSource, where ugComm is the UltraGrid that the row is deleted from, followed by testDS.Tables.Add(testDT). Next, if the user confirms they do want to delete the row, then the row is deleted, I then want update the DataTable so that it can still have the deleted row in it, but have the RowState as Deleted.
The reason I need to do this, is so that when updating the data, I can test
For Each dr as DataRow in testDT.Rows
If dr = datarowstate.deleted Then ' Execute Delete Query Else 'Upsert query End If
Is there any way of doing this? Or, is there an alternative way that I’m missing?