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.Fields >
<FIELD LAYOUTS> </igDP:FieldLayout.Fields >
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Note that I have a typo, both of the ParentKeys read "CabinData" not "CabinList"
Also, I can NEVER get a summary row to appear. I have scoured the internet and nobody has a sample beyond the far-too-simplistic one that is in the feature browser. I can't believe that we are the only people in the world to not be binding to datasets but to collections of rich objects. Also, despite there being claims that you can have multiple children, I also find no example in the feature browser or in anyone's published examples. I have a feeling it is just something simple which is why I'm surprised there is so little info on it.
I also would like to figure out how to have two child collections for a row. Each with their own expansion button.
Hello,
It has been a while since you have made your posts, in case you still need of support I will be glad to assist you on the matter. I was looking into your post and regarding your first question I believe that the issue may be caused if you don’t have a property named exactly “ColTemp” in your collection. This is why I can suggest you just change this to UnboundField:
<igDP:UnboundField Label="Customer Summary" Name="ColTemp" Visibility="Hidden"/>
Furthermore you can have a look at the following link forum our forums where Alex Fidanov implements something like footer row :
http://community.infragistics.com/forums/t/43348.aspx
Regarding your last question, a possible approach to have a row with a two child collection is for you to set as DataSource of the XamDataGrid a collection from object that has as two Collection fields. For example Collection of Continent object, defined like follows :
public class Continent
{
public string Name { get; set; }
public ObservableCollection<Country> Countres1 { get; set; }
public ObservableCollection<Country> Countres2 { get; set; }
}
For further reference you can have a look at the attached sample.
If you need any furhter assistance on this, please do not hesitate to ask.