Error after DeleteRow event - Cannot perform this operation on a row not in a table

1 reply. Last post: June 3, 2010 11:34 PM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Mike DearmanMember

I have a grid manually bound to a DataSet and am handling the DeleteRow event with custom code.

 

I noticed the grid does not automatically set the underlying DataRow object to the Deleted state.
The row currently has the RowState of Unchanged.
I need to call the DataRow.Delete method on this row so that my data adapter can see that the row was deleted properly.

However, during the DeleteRow process I call the AcceptChanges method so that the DataSet is committed properly.  This makes the row Detached.

Immediately after leaving the DeleteRow event, the WebGrid throws an internal error "Cannot perform an operation on a row not in the table".

 

What is the proper order/methods to call to properly delete a DataRow in the underlying data source and have it delete the WebGridRow without error in the grid.  The above methods used to work in WebGrid 3.5 but now doesn't in WebGrid 7.

 

Thanks,

Mike

All times are GMT -5. The time now is 9:44 PM.
Previous Next