Deleting an Item in an Editable List Object

Deleting an Item in an Editable List Object

Old forum URL: forums.lhotka.net/forums/t/2203.aspx


Inquistive_Mind posted on Wednesday, January 24, 2007

Hello,

I am getting the below error and it is not making sense to me.I am following the Project Tracker example.I have an editable list bound to the grid.On click event of some buttons this Editable List Object  must be filtered out and rebound to the grid.On a button click even I am trying to remove some of the items in the list based on a criteria.I was able to sucessfully use the ObjectListView (Thanks to Brian Criswell) to filter out a ReadOnly List.In this case no clue :-( whats happening.Any Information would be helpful.

 

Thanks in Advance

V

Invalid for root objects - use Delete instead

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Invalid for root objects - use Delete instead

Source Error:

Line 43:                 if (eRepairInfo.RepairTypeID.Equals(repairTypeID))
Line 44:                 {
Line 45:                     Remove(eRepairInfo);
Line 46:                   break;
Line 47:                 }

ajj3085 replied on Wednesday, January 24, 2007

The object which is in the list must be marked as a child object.  Did you call MarkAsChild in the instances constructor?

Inquistive_Mind replied on Thursday, January 25, 2007

Oops got it.Thanks.I did not have the MarkAsChild().

Copyright (c) Marimer LLC