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
2090
XamDatagrid with three fieldlayouts
posted

Hello,

I have a XamDatagrid with three fieldlayouts:

0. Parent-projects

1. Optional child-projects

2. assigend ressources to parent or child project

At the moment the combination of 0+2 works very fine.

Some parent projects contain also child-projects. If such child-projects exits I need to expand them and show the assigned resources.

This means that I have sometimes a relation between 0+2 and sometimes 0+1 and 1+2

Questions:

1. How do does XAML for this scenario look like?

2. How do I need to design the relation between the fieldlayouts 0,1 and2?

Your input is very welcome

Thanks

Niko

  • 2680
    Offline posted

    Hi Nikolaus,

    Thank you for posting to Infragistics Community!

    I have been looking into your question and I believe the “Displaying Hierarchical Data” topic from the XamDataGrid documentation will be quite helpful on the matter.

    Additionally, I have prepared a small sample with a XamDataGrid displaying a 3-level hierarchical data, which you can find attached below.The sample demonstrates handling the InitializeRecord event of the grid in order to expand records that have children. Optionally, the expansion indicator visibility could be altered as well:

            private void XamDataGrid_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)
            {
                if (e.Record.HasChildren)
                {
                    e.Record.IsExpanded = true;
                } else
                {
                    e.Record.ExpansionIndicatorVisibility = Visibility.Collapsed;
                }
            }
     In conclusion, please, check out the referenced resources and let me know if they help.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

    3000.XDGHierarchicalData.zip