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
165
Hiding labels for child rows
posted

Hello,

I am setting up a XamDataGrid control:

  • It has two levels of records (parent & child).
  • The fields for each level are generated automatically from the dataset. They are also identical for both parent and child.

Currently, the header line (field names) is displayed at the top of the grid and also for each set of child records when a parent record is expanded.

Is there any way to set the grid up so that the header line is displayed only at the top, and not for each expanded child level?

I have tried using LabelLocation="Hidden" but then the top-level headers disappear as well.

Thanks

Parents
No Data
Reply
  • 12875
    Verified Answer
    posted

    Hi,

    The simple answer is that you can define the parent and child layouts without the Fields defined and still set the AutoGenerateFields to True so that the fields are generated.  Then you add the FieldLayoutSetting LabelLocation set to Hidden to the child layout.  

    I also wired up the AssigingFieldLayoutToItem event and assign the parent and child layouts. 

    I’m attaching a sample that may be helpful to you. 

    Please let me know if you have any questions.

    WPF_XDG_NoHeadersForChildLayouts.zip
Children