Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3305
Can I show the value of a child list in the parent row of a Grid
posted

I have a grid bound to a list of entity objects and each one has a child list but each child list only has one item (row per say)

Our designers do not want to show a child row, So is there a way to directly bind to a field property in the first row of a child list thru the xaml?

I know  some code workarounds to handle this but I'm hoping there is a wasy to do this in xaml

  • 27093
    posted

    Hello, 

    I am just checking if you got this worked out, or you still require any assistance, or clarification on the matter.

    If this is what you were looking for please verify the answer so it helps other users as well.

  • 5170
    Verified Answer
    Offline posted

    Very easy to do in XAML.  Just use string indexers on the child collection.

           

    <ig:XamGrid ItemsSource="{Binding People}" AutoGenerateColumns="False" >

               

    <ig:XamGrid.Columns>

                   

    <ig:TextColumn Key="FirstName" HeaderText="Parent First" />

                   

    <ig:TextColumn Key="LastName" HeaderText="Parent Last" />

                   

    <ig:TextColumn Key="Children[0].FirstName" HeaderText="Child First" />

                   

    <ig:TextColumn Key="Children[0].LastName" HeaderText="Child Last" />

               

    </ig:XamGrid.Columns>

           

    </ig:XamGrid>