Hi,
I have hierarchical data that I need to display as nested hierarchies. I'm currently letting the xamDataGrid display it a a treeview but would like the nodes to be fully expanded always without the option to collapse. So the questions are how do I force the treenodes to fully expand initially and how do I hide the expansion indicators (+/-)? Or is there a better way to do this? I'm open to any and all creative ideas.
Secondly, I need to combine two datafields into one for display (i.e city, state). Does the databinding support this in some way or do I have to create a property (I'm displaying a hierarchy of objects with nested collections of objects) in the object that does the concatenation? I've read the help about complex data and I don't think my need is addressed by it and I saw another post that expressed the same need and it was never responded to. Any ideas?
Thanks!
Glenn
Hi Glenn,
I'm dealing with the same 'expand' problem. There is a FieldSettings property named "ExpandableFieldRecordExpansionMode" that has an "AlwaysExpanded" option but I can't get it to work. I've tried applying it at the Grid level and at the FieldLayout levels without any results. I talked to a support rep yesterday who couldn't figure it out. I've submitted it as an email support request and if I get any response, I'll update you.
Will D.
Thanks Will!
I had tried the same property and, like you, it didn't do anything for me either. I guess we'll just have to wait...
Hey Glenn,
I got a programmatic solution from the poor support guy that I was harassing yesterday. Try this or the C# equivelent:
e.Handled = True
e.Record.IsExpanded = True
e.Record.ExpansionIndicatorVisibility = System.Windows.Visibility.Collapsed
End Sub
Will
This appears to be working correctly now for a 3 tier hierarchy in the WPF 2008 v1 version released today.
Hmmmm. I have only a two level hierarchy. My DataSource is a BindingList(Of MyType) that has nested BindingList(Of MyOtherType) . Don't know if that's the same as yours.
In case it might help here's my XAML:
<igDP:XamDataGrid x:Name="lstOffenses" Height="3in" MinWidth="4in" Grid.Row="1"
DataSource="{Binding Source={StaticResource odpOffenses}}"
Background="{StaticResource BackgroundBrush}"
UpdateMode="OnRecordChangeOrLostFocus"
GroupByAreaLocation="None" TabIndex="3" AutoFit="True">
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout Key="Parent">
<igDP:FieldLayout.Settings>
<igDP:FieldLayoutSettings HighlightAlternateRecords="True"/>
</igDP:FieldLayout.Settings>
<igDP:FieldLayout.Fields>
<igDP:Field Name="DocketNumber" Label="Docket Number"/>
<igDP:Field Name="ArrestDate" Label="Arrest Date"/>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
<igDP:FieldLayout Key="Child">
<igDP:FieldLayoutSettings HighlightAlternateRecords="True" AddNewRecordLocation="OnTop" AllowAddNew="True"/>
<igDP:Field Name="OffenseAsCharged" Label="Offense As Charged"/>
<igDP:Field Name="OffenseAsConvicted" Label="Offense As Convicted"/>
<igDP:Field Name="StatutesAndPenalties" Label="Statutes And Penalties"/>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Hope that helps,
Hi Will!
Almost but ...it goes thru InitializeRecord the correct number of times but the ui only shows the top level nodes...the children aren't visible and of course because the ExpansionIndicatorVisibility = collapsed there's not + sign to get to them with...if I make the expansion indicator visible it initially shows a minus sign...clicking it twice finally shows the children AND grandchildren. So something is still not right.