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
75
Hierarchical data - one parent two child collections?
posted

Hi all,

I have been struggling with a certain scenario for a fairly complex grid we are developing. I have pasted some sample XAML and bolded the line that isn't working).  I didn't include the actual field layout definitions as that isn't the problem - I am overriding the cellvaluepresenter to present the data using some standard controls. I'd just like any extra row to appear after the first child records.  (I'm using infragistics 10.2 CLR 4 service release)

In short, I have the CabinModelCollection which is a class with many properties.  PaxList is one of those properties, and it is a List(Of PaxModel).  ColTemp is a sample List (Of TempModel).  If I just have the PaxList field defined, everything works.  Whenever I try to add a second child (the bold line), nothing displays (no databinding errors or anything else is occurring).  No children at all display.

 My main issue is that I want a "footer row" (that I was trying to fake with the ColTemp object).  I don't really want a "summary", I want a footer to appear that uses properties from the parent object (CabinModelCollection) AFTER the PaxList children.  However I'd make whatever models / data manipulations necessary to accomplish this but I just have not been able to find a sample in the feature browser or the internet that is doing exactly what I want.   I need two fieldlayouts to have the same ParentFieldLayoutKey.  Or at least I need to figure out how to simulate that.

I do have some rules in place that should make this easier - Each parent would have exactly ONE child object and ONE footer row/object.  Child objects have no further children.  I've seen something about NestedProperties but have been unable to make that happen either.  Is there anything obvious I'm doing wrong?

 

             <igDP:XamDataGrid x:Name="grdCabinList" IsUndoEnabled="True" Height="Auto"
                                DataSource="{Binding CabinModelCollection}"         
                                IsGroupByAreaExpanded="False"                                             
                                GroupByAreaLocation="None"                                
                                GroupByAreaMode="DefaultFieldLayoutOnly"
                                ScrollViewer.VerticalScrollBarVisibility="Auto" 
                                ScrollViewer.CanContentScroll="True"                                                           
                                IsSynchronizedWithCurrentItem="True" Margin="0,5,0,0"                               
                                           RecordContainerGenerationMode="LazyLoad"                                                                       
                                CellContainerGenerationMode="LazyLoad">
                                     
                     
                            <igDP:XamDataGrid.FieldLayoutSettings>
                                <igDP:FieldLayoutSettings                                  
                                RecordSelectorLocation="None"
                                HighlightAlternateRecords="True"
                                AutoGenerateFields="False"                                
                                SelectionTypeCell="None"
                                SelectionTypeField="None"
                                SelectionTypeRecord="Range"
                                AllowClipboardOperations="All"                                   
                                AllowFieldMoving="No"                                   
                                   />
                            </igDP:XamDataGrid.FieldLayoutSettings>
                            <igDP:XamDataGrid.FieldLayouts>

                                <igDP:FieldLayout Key="CabinData"  >
                                    <igDP:FieldLayout.Settings>
                                        <igDP:FieldLayoutSettings LabelLocation="Hidden"/>
                                    </igDP:FieldLayout.Settings>
                                   
                                    <igDP:FieldLayout.FieldSettings>
                                        <igDP:FieldSettings
                                            ExpandableFieldRecordHeaderDisplayMode="NeverDisplayHeader"/>                                                                                                                                                                          
                                    </igDP:FieldLayout.FieldSettings>
                                   
                   <igDP:FieldLayout.Fields>
                    <igDP:UnboundField Label="" BindingPath="Ind_Book_Nbr" Name="CabinData" BindingMode="OneWay"  Width="Auto" >
                        <igDP:UnboundField.Settings>
                            <igDP:FieldSettings EditAsType="{x:Type sys:String}">
                                <igDP:FieldSettings.CellValuePresenterStyle>
     <ADDED CUSTOM STYLE NOT IMPORTANT TO SAMPLE>

      </igDP:FieldSettings.CellValuePresenterStyle>
    </igDP:FieldSettings>
    </igDP:UnboundField.Settings>
</igDP:UnboundField>

<igDP:Field Label="Customer Data" Name="PaxList" Visibility="Hidden"/>
<igDP:Field Label="Customer Summary" Name="ColTemp" Visibility="Hidden"/>

<!-- If I remove the bolded line above, the hierarchical data for the PaxList displays exactly as I want -->


  </igDP:FieldLayout.Fields>

  <igDP:FieldLayout Key="PaxList" ParentFieldLayoutKey="CabinData" ParentFieldName="PaxList">
                     <igDP:FieldLayout.FieldSettings>                                                                             
                                        <igDP:FieldSettings AllowEdit="True" LabelTextAlignment="Center" AllowResize="False" 
                                            AllowCellVirtualization="True"                                         
                                            AllowLabelVirtualization="True"                                                           
                                            Height="Auto"                                                           
                                            AllowRecordFiltering="False"                                                       
                                            LabelClickAction="Nothing"
                                            CellClickAction="EnterEditModeIfAllowed"
                                            AllowSummaries="True"
                                            />

                    </igDP:FieldLayout.FieldSettings>

<igDP:FieldLayout.Fields >
<FIELD LAYOUTS NOT IMPORTANT TO EXAMPLE>
</igDP:FieldLayout.Fields>
 
 </igDP:FieldLayout>


                                <igDP:FieldLayout Key="ColTemp" ParentFieldLayoutKey="CabinList" ParentFieldName="ColTemp">
                                    <igDP:FieldLayout.FieldSettings>
                                        <igDP:FieldSettings AllowEdit="True" LabelTextAlignment="Center" AllowResize="False" 
                                            AllowCellVirtualization="True"                                         
                                            AllowLabelVirtualization="True"                                                           
                                            Height="Auto"                                                           
                                            AllowRecordFiltering="False"                                                       
                                            LabelClickAction="Nothing"
                                            CellClickAction="EnterEditModeIfAllowed"
                                            AllowSummaries="False"
                                            />

                                    </igDP:FieldLayout.FieldSettings>

                            <igDP:FieldLayout.Fields >

<FIELD LAYOUTS>
        </igDP:FieldLayout.Fields >

    </igDP:FieldLayout>

                                                                                                               
     </igDP:XamDataGrid.FieldLayouts>

            </igDP:XamDataGrid>

 

Parents Reply Children
No Data