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
905
Hierarchical DataPresenter Styling (Headers?)
posted

I have a XamDataGrid that has a parent/child (Project/Assessment) relationship. I've managed to indent the child rows via a DataPresenterStyleSelector, but it would be helpful if there was some sort of header above the child rows indicating what they were. Something like the blue rows, which appear above the column headers.

Grid Mockup

Parents
  • 6365
    Verified Answer
    Offline posted

    Hello Danielle,

    Thank you for the screenshots you have provided.

    I have been looking into your issue and the header (ExpandableFieldRecordHeader) you have mentioned does exist when the child collections for every record from the initial FieldLayout are two or more. This behavior for the XamDataGrid is by design.

    If you would like to keep the ExpandableFieldRecordHeader visible, even when you are using a single collection, an easy way of achieving this would be to create a new and empty, dummy collection. This way the XamDataGrid will recognize the multiple collections' existence and will automatically enable the ExpandableFieldRecords. 

    1) Afterwards by setting the ExpandableFieldRecordExpansionMode property to ExpandAlways and the ExpandableFieldRecordHeaderDisplayMode property to AlwaysDisplayHeader for the collection's Field that should be visualized, you should be able to achieve the desired functionality.

    /
    / Visualized collection
    <igDP:Field Name="Bills">
                    <igDP:Field.Settings>
                                    <igDP:FieldSettings ExpandableFieldRecordExpansionMode="ExpandAlways" ExpandableFieldRecordHeaderDisplayMode="AlwaysDisplayHeader" /> 
                    </igDP:Field.Settings>
    </igDP:Field>

    2) Please note that in order to disable the visualization of the dummy collection as a child FieldLayout, you can do this by setting the Visibility of the corresponding collection's Field to Collapsed:

    // Dummy collection
    <igDP:FieldLayout Key="parentLayout">
                    <igDP:Field Name="Items" Visibility="Collapsed" />
    </igDP:FieldLayout>

    I have prepared a sample application where this behavior has been introduced. Would you please take a look at it and if you are still experiencing any issues or this is not the behavior you were aiming for, please let me know.

    XamDataGrid_hierarchicalDataLayout.zip
Reply Children