Hi,
I have a grid which to user can modify an entity within a collection. If the user modifies an entity I don't save it until the user exits the screen. The user can also delete an entity and the delete happens right away.
If the user first modifies an entity and then deletes an entity the entity gets deleted. When the user exists the screen the program tries to save the entity collection and aborts because it tries to update a deleted enity.
Here I delete and Assignment:
Dim catidx = GradeBookMain.GradeBookCourse.Category.IndexOf(_SelectedCategory)
GradeBookMain.GradeBookCourse.Category(catidx).Assignment.Remove(Assignment)
MedfordSchoolDistrict.GradeBook.MedfordCommon.DeleteEntity(Assignment)
This is where I update on exit of the screen:
GbMgr.CourseManager.SaveEntity(GradeBookMain.GradeBookCourse)
Here is the trace:
exec sp_executesql N'UPDATE [GradeBook].[dbo].[Assignment] SET [CategoryId]=@CategoryId,[Sequence]=@Sequence WHERE ( [GradeBook].[dbo].[Assignment].[AssignmentId] = @AssignmentId1)',N'@CategoryId int,@Sequence smallint,@AssignmentId1 int',@CategoryId=NULL,@Sequence=12,@AssignmentId1=28282
Any help would be appreciated.
I'm on version 2.6