Bind DetailsView to nested object

Posts   
 
    
colincsb
User
Posts: 18
Joined: 01-Nov-2006
# Posted on: 20-Nov-2006 10:39:34   

I have an object hierarchy with Organisation - ContactDetail. The ContactDetail class is obtained from the Organisation instance via a property called PersonName.

I have a master GridView that displays a list of Organisations. When I select a row in the grid I want the DetailsView to display the fields from the ContactDetail instance associated with the Organisation.

I have the following code in my page:


   <llblgenpro:LLBLGenProDataSource ID="OrganisationDS" runat="server" DataContainerType="EntityCollection"
        EntityCollectionTypeName="CVCheck.DB.CollectionClasses.OrganisationCollection, CVCheck.DB">
</llblgenpro:LLBLGenProDataSource>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="OrganisationId" DataSourceID="OrganisationDS" >
           ........
</asp:GridView>

How do I define the DetailView and its associated datasource to achieve this??

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 20-Nov-2006 10:44:14   
Frans Bouma | Lead developer LLBLGen Pro