This question is locked. New answers and comments are not allowed.
Hi Telerik OA team,
In a winforms situation, I have several databound grids in several tabs on one form. I want to save all changes with one button. Sofar this works nicely, however I have one problem.
Deleting a (referenced) object from the grid does not generate a "The delete statement conflicted with the reference constraint"-error, until _context.SaveChanges() is called from the save button. So the question is (given this grid event code):
Added complication: the grid(s) are filled runtime, so the containing objects (row.DataBouddItem) are not typed.
Any ideas to get this working?
Thanks in advance,
Alex
In a winforms situation, I have several databound grids in several tabs on one form. I want to save all changes with one button. Sofar this works nicely, however I have one problem.
Deleting a (referenced) object from the grid does not generate a "The delete statement conflicted with the reference constraint"-error, until _context.SaveChanges() is called from the save button. So the question is (given this grid event code):
Private Sub rg_UserDeletingRow(sender As Object, e As GridViewRowCancelEventArgs) Dim row As GridViewDataRowInfo = e.Rows(0) Try If row.DataBoundItem IsNot Nothing Then 'if NoReferenceConstraint() Then _ <- How to detect a reference constaint? _context.Delete(row.DataBoundItem) End If Catch ex As Exception e.Cancel = True RadMessageBox.Show(ex.Message) End TryEnd SubAdded complication: the grid(s) are filled runtime, so the containing objects (row.DataBouddItem) are not typed.
Any ideas to get this working?
Thanks in advance,
Alex