none
Binding to a related class in a SortableListView

    Question

  • Hello,

    I have a type projection defined like this:

    <TypeProjection ID="CITAM.TP.Service.Infrastructure_Hosting" Accessibility="Public" Type="CITAM.Service.Infrastructure_Hosting">
              <Component Path="$Context/Path[Relationship='ServiceHasCostCenter' SeedRole='Source']$" Alias="CostCenter" />
              <Component Path="$Context/Path[Relationship='ServiceHasBusinessUnit' SeedRole='Source']$" Alias="BusinessUnit" />
              <Component Path="$Context/Path[Relationship='ServiceHasSupportGroup' SeedRole='Source']$" Alias="SupportGroup" />

    I have XAML that looks like this:

    <scwpf:SortableListView x:Name="lsvServices" ItemsSource="{Binding Service}" MouseDoubleClick="MouseDoubleClick_lsvServices" Style="{StaticResource slvStyle}">
                                <scwpf:SortableListView.View>
                                    <GridView>
                                        <scwpf:SortableGridViewColumn SortPropertyName="Service_ID" DisplayMemberBinding="{Binding Service_ID}" Header="ID"/>
                                        <scwpf:SortableGridViewColumn SortPropertyName="$Class$.DisplayName" DisplayMemberBinding="{Binding $Class$.DisplayName}" Header="Class"/>
                                        <scwpf:SortableGridViewColumn SortPropertyName="Start_Billing_Date" DisplayMemberBinding="{Binding Start_Billing_Date, StringFormat=d}" Header="Start Billing Date"/>
                                        <scwpf:SortableGridViewColumn SortPropertyName="End_Billing_Date" DisplayMemberBinding="{Binding End_Billing_Date, StringFormat=d}" Header="End Billing Date"/>
                                        <scwpf:SortableGridViewColumn SortPropertyName="BusinessUnit.DisplayName" DisplayMemberBinding="{Binding BusinessUnit.DisplayName}" Header="BU"/>
                                        <scwpf:SortableGridViewColumn SortPropertyName="$LastModified$" DisplayMemberBinding="{Binding $LastModified$}" Header="Last Modified"/>
                                    </GridView>
                                </scwpf:SortableListView.View>
                            </scwpf:SortableListView>

    No matter what I try I can't get the BusinessUnit.DisplayName property to show up on the list view - it is always blank. I've tried putting $ around DisplayName, using Service.BusinessUnit.DisplayName - nothing works. I feel like I'm missing something obvious here - can anyone help? Oh - I'll also mention that the ServiceHasBusinessUnit relationship is * to 1 (many services to one business unit).
    Wednesday, April 03, 2013 9:02 PM

Answers

  • From your XAML snippet looks like SortableListView binded to another type projection but to CITAM.TP.Service.Infrastructure_Hosting. In this case no matter what components defined in CITAM.TP.Service.Infrastructure_Hosting TP. You must check a TP on which your form is targeted.


    SCSMSolutions
    email: freemanru (at) gmail (dot) com

    • Marked as answer by John Hennen Wednesday, April 03, 2013 11:36 PM
    Wednesday, April 03, 2013 10:33 PM
    Moderator

All replies

  • From your XAML snippet looks like SortableListView binded to another type projection but to CITAM.TP.Service.Infrastructure_Hosting. In this case no matter what components defined in CITAM.TP.Service.Infrastructure_Hosting TP. You must check a TP on which your form is targeted.


    SCSMSolutions
    email: freemanru (at) gmail (dot) com

    • Marked as answer by John Hennen Wednesday, April 03, 2013 11:36 PM
    Wednesday, April 03, 2013 10:33 PM
    Moderator
  • Ah you are correct!  Dumb mistake on my part - not only was I looking at the wrong TP but I had recently updated the correct TP such that what I was trying to do wouldn't work.  I fixed the TP and everything works great now.  Thanks!
    Wednesday, April 03, 2013 11:36 PM