Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi,
I have a form contains two business objects. I used ASPxGridView to bind to WebBBS which attach CHildBO. In Page_Load, I have code to set ChildBO.ParentBusinessObject = ParentBO if !IsPostback.
I am facing problem that, whenever I add new record to ASPxGridView, WebBBS.CreateShareAndAddBusinessObject() would be fired. In this method, it will clone the ChildBO; assign ChildBO.ParentBusinessObject to ClonedBO.ParentBusinessObject.
Whenever this happens, program try to access the ParentBO instance and add ClonedBO to its ChildBusinessObject collection. As all BOs are stored in Session, it cause existing ParentBO.ChildBusinessObjects retain and keep been added new ClonedBO.
It caused some error for that if I loop thru ParentBO.ChildBusienssObjects to do something.
Please advice.
|