I have two objects with a 1-1 relationship
ie, a House object that has a GardenId property that references a Garden object
and a Number property that contains the street number of the house
so i could write code as follows
HouseEntity h = new HouseEntity(21);
h.Number = 13;
h.Garden.Width = 100;
h.Save(true);
in this case the House's street number would be set to 13 and the associated
Garden object, Width property would be set to 100,
Because the recurse parameter of the House's Save() method has been set to true
the Garden's Width property would also be properly persisted
My question is if I want to bind this Garden.Width property to a TextBox in a FormView
it would be something like this:
<asp:FormView ID="HouseDetailsFormView" runat="server"
DataKeyNames="HouseId" DataSourceID="HouseDetailsDataSource">
<EditItemTemplate>
<asp:TextBox ID="HouseNumber" runat="server"
Text='<%# Bind("Number") %>' />
<br/>
<asp:TextBox ID="GardenWidth" runat="server"
Text='<%# Bind("Garden.Width") %>' />
</EditItemTemplate>
</asp:FormView>
<llblgenpro:LLBLGenProDataSource ID="HouseDetailsDataSource" runat="server"
DataContainerType="EntityCollection"
EntityCollectionTypeName="MyDatabase.CollectionClasses.HouseCollection,
MyDatabase" >
</llblgenpro:LLBLGenProDataSource>
However
When I update this FormView, the House's Number property is persisted, but the Garden.Width property is not.
I need to figure out how to persist recursively using DataBinding.
Thanks