I have a 2 Custom objects called BLPerson and BLProject. BLPerson contains a child property called Projects which is a collection of BLProject. Property Projects goes to the database and gets all the projects that person owns.
When I create an instance of BLPerson the Projects property does not fire until it is referenced however if if i point the BLPerson instance to a grid whose DisplayLayout.LoadStyle=LoadOnDemand then the Projects property fires immediatley i.e before the User clicks on the "+" sign to show the Projects child band.
Is there a way to only have the child properties of my object fire when the User clicks on the "+" sign to open them ? Some of the objects contain several children so it is quite an overhead to get the data if its not required.
Thanks john
Hi,
It's hard to say without seeing the code.
If you put a breakpoint in the Projects property getter, you could see who is asking for the Projects and get an idea of why they are getting created.
My guess is that the BindingManager is going this in order to determine the data structure for the child bands. In which case, I'm not sure if there is any way to stop that. The WinGrid always builds the Bands and columns up front as soon as you bind it. So it has to create the BindingManager and get the structure.
After seeing another append on this subject and doing some tests, it appears that this is only hapenning for the 1st row i.e my objectis getting data for itself and all its children but only for row 1.
This is now not such an issue but if there is an easy way to stop itthen it would be good