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
180
Display child record info in line with parent record
posted

I am using XamDataGrid 11.2, I have successfully managed to bind the data to the grid.

There is one issue I'm having.

The record is an entity.

Object - ContactID (int)
               Contact (object)
               etc.

I want to display information that is stored in Contact in the same line as the original object, instead of Object being expandable to see the Contact information.

So it appears:
ContactID | FirstName | Surname | etc.

I tried setting up a FieldLayout that had:

<igDP:Field Name="ContactID" Label="Contact ID" />
<igDP:Field Name="Contact.FirstName" Label="First Name" />
<igDP:Field Name="Contact.Surname" Label="Surname" />
I know that FirstName and Surname exist in the Contact object but not sure how or if it's possible to display it how I want to.

 

Parents
  • 180
    Verified Answer
    posted

    I have figured out what my problem was.

    I solved it try creating a style for my field.

    <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="ContactCell">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                            <Label Content="{Binding Path=DataItem.Contact.FullContactName}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
    This creates a label that will display Contact.FullContactName!
    I will know this when I encounter such an issue in the future!
Reply Children
No Data