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
465
Collapsing a field in the hierarchical data
posted

I can successfully collapse the ID field in the xamdatagrid below, despite having it autogenerate the fields like this:

However it only collapses it in the main rows, all nested (hierarchical) rows are unaffected, how do I make sure their ID field is also collapsed please?

<igDP:XamDataGrid x:Name="xamDataGridOutput" DataSource="{Binding VariableDataSource}" Theme ="Aero">
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="True"/>
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="ID" Label="ID" Visibility="Collapsed"/>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>

 

Parents
  • 69686
    Verified Answer
    posted

    Hello,

    A quick way to always collapse a Field that has a name of "ID" is to handle the FieldLayoutInitialized event of the XamDataGrid and check if the currently initialized layout has a field that has an "ID" name (check the Fields collection - e.FieldLayout.Fields) and collapse it.

Reply Children
No Data