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
170
Display Nested Fields for a Row
posted

Hello,

I'd like to display a "nested panel" when a User clicks on a Row in the xamDataGrid.

 

This is the code I tried to use:

                            <igDp:XamDataGrid.FieldLayouts>
                                <igDp:FieldLayout Key="MyParent" >
                                    <igDp:FieldLayout.FieldSettings>
                                        <igDp:FieldSettings ExpandableFieldRecordHeaderDisplayMode="AlwaysDisplayHeader"/>    
                                    </igDp:FieldLayout.FieldSettings>
                                    <igDp:FieldLayout.Fields>
                                        <igDp:Field Name="CountryCode" Label="CountryCode" />
                                        <igDp:Field Name="CountryName" Label="CountryName" />
                                        <igDp:Field Name="Detail1" Label="Detail1" />
                                        <igDp:Field Name="Detail2" Label="Detail2" />
                                        <igDp:Field Name="Detail3" Label="Detail3" />
                                        <igDp:Field Name="MyDetails" Label="MyDetails" Visibility="Hidden" />
                                    </igDp:FieldLayout.Fields>
                                </igDp:FieldLayout>
                                <igDp:FieldLayout Key="MyDetails" ParentFieldLayoutKey="MyParent" KeyMatchingEnforced="True">
                                    <igDp:FieldLayout.Settings>
                                        <igDp:FieldLayoutSettings />
                                    </igDp:FieldLayout.Settings>
                                    <igDp:FieldLayout.Fields>
                                        <igDp:Field Name="DetailCode" Label="DetailCode" />
                                        <igDp:Field Name="DetailText" Label="DetailText" />
                                    </igDp:FieldLayout.Fields>
                                </igDp:FieldLayout>
                            </igDp:XamDataGrid.FieldLayouts>

 

And this is how my class looks like:


    public class CountryRowViewModel
    {
        public int CountryCode { get; set; }
        public string CountryName { get; set; }
        public string MyHiddenProperty { get; set; } /* I don't want to display this*/
        public string Detail1 { get; set; }
        public string Detail2 { get; set; }
        public string Detail3 { get; set; }

        public DetailsViewModel MyDetails { get; set; }

        public class DetailsViewModel
        {
            public int DetailCode { get; set; }
            public string DetailText { get; set; }
        }
    }

I want to display the nested "field layout" without using AutoGenerateColumns=true, since there will be some custom additions. Any idea how to do that?

Also how would I have to change the code to display e.g. a StackPanel or a TabControl (for Charts) instead of a nested grid?

 

Thanks a lot!

Regards,

Andreas