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
610
Binding to a list the has a list as a property
posted

Hi,

  I'm trying to bind to an observable collection that has a list as one of its properties.  I want the list it to display as a group by when you click the + sign.  The PrimeBrokerAccountItems is the list.  Any help would be appreciated.  Thanks.

        <Custom:XamDataGrid Name="SampleGrid" DataSource="{Binding MasterAccounts, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="216,149,0,0" VerticalAlignment="Top">
            <Custom:XamDataGrid.FieldLayoutSettings>
                <Custom:FieldLayoutSettings AutoGenerateFields="False"/>
            </Custom:XamDataGrid.FieldLayoutSettings>
            <Custom:XamDataGrid.FieldLayouts>
                <Custom:FieldLayout IsDefault="true">
                    <Custom:FieldLayout.Fields>
                        <Custom:Field Width= "150" Name="MasterAccountId" Label="Master Account" Row="1"  Column="0"/>
                        <Custom:Field Width= "150" Name="CombinedMargin" Label="Combined Margin" Row="1"  Column="1"/>
                        <Custom:Field Width= "150" Name="AscMargin" Label="Asc Margin" Row="1"  Column="2"/>
                        <Custom:Field Width= "150" Name="PrimeBrokerAccountItems" Label="Account Id" Row="1"  Column="3"/>
                        </Custom:FieldLayout.Fields>
                        </Custom:FieldLayout>
            </Custom:XamDataGrid.FieldLayouts>
        </Custom:XamDataGrid>

Parents
No Data
Reply
  • 16495
    Offline posted

    Hello Jeff,

    Thank you for your post.

    I have been looking into your issue and the code that you have provided and I can suggest you create one more FieldLayout for the type of the items in your collection property. To display a list as GroupBy I can you add a FieldSortDescription in the SortedFields of the child FieldLayout, for the Field that you wish to be grouped.I created a sample application based on your scenario  to show you how you can implement the functionality that you want to achieve.

    Please let me know if you need any further assistance on this matter.

    CollectionWithListProperty.zip
Children