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
700
xamDataGrid hierarchical grid (sub-grid) ability to define selectively
posted

hello, 

i am follow the simple example included in my Infragistics WPF SDK (v11.1) in having a subgrid.

This works, however, it creates a subgrid for every collection on my main object, and a column for every field on the SubObject. 

1. I would like the subgrid to show only for a collection property called Adjustments (which is a BindingList<MyType>).  

2. I would like to be able to show subgrid columns selectively

3. I would  like to be able to expand/collapse all subgrids "expand all / collapse all" 

My grid definition:

        <!-- Grid -->
        <igDP:XamDataGrid Grid.Row="1" x:Name="TransactionsGrid" 
                          DataSource="{Binding Transactions}" 
                          RecordContainerGenerationMode="Virtualize" 
                          SelectedItemsChanged="TransactionsGrid_SelectedItemsChanged"
                          c:MouseDoubleClickBehavior.MouseDoubleClickCommand="{StaticResource TopsideEditCommand}"
                          FontSize="11">
            <igDP:XamDataGrid.FieldSettings>
                <igDP:FieldSettings AllowEdit="False" />
            </igDP:XamDataGrid.FieldSettings>
            <igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:FieldLayoutSettings AutoGenerateFields="True" AllowAddNew="False" AllowDelete="True" SelectionTypeRecord="Single" HighlightAlternateRecords="True" />
            </igDP:XamDataGrid.FieldLayoutSettings>
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="UID" Label="" Width="20" />
                        <igDP:Field Name="EntityName" Label="Entity" Width="200" />
                        <igDP:Field Name="ReasonName" Label="Reason" />
                        <igDP:Field Name="PocketName" Label="Side Pocket" Width="200" />
                        <igDP:Field Name="Notes" Width="300" />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
                <!-- Subgrid -->
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="FinancialAccount" Visibility="Collapsed" />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
        </igDP:XamDataGrid>


i would also like to set AutoGenerateFields to false, if possible. 

thanks.