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
345
Display hierarchical data in normal column format
posted

In short I'm trying to display hierarchical data in a "normal" column format:

I think the best way to explain it is showing the data structure to which I'm binding to:

List<ContactPerson> _ContactPersons = new List<ContactPerson>();

Where ContactPerson has the following definition:

public class ContactPerson
    {

        public List<tbl_ContactData> ContactData { get; set; }
    }

This weird way of doing a contacts table is the result of a requirement to let the user define the columns dynamically. So as you can see from the screenshot, the grid is bound to one contact "record" and I would like to make it show this record as a single row instead of multiple ones (pivot it in some way?). I would like to do it without hardcoding any fieldlayouts as the amount of columns and their names will be dynamic.

If anyone has any suggestions on where to start I would appreciate the help!

 

 

  • 69686
    posted

    Hello,

    To the best of my knowledge, there is no easy way to achieve this. The nested content of the ContactPerson class will be displayed in ExpandableFieldRecordPresenter. You can see the default style for the ExpandableFieldRecordPresenter in the DefaultStyles directory in the Infragistics folder on your computer.

    One way is to retemplate it - the content control and its itemspanel.

    You can see an example of how to retemplate the ExpandableFieldRecordPresenter in the XamFeatureBrowser.

    You can also use the Snoop tool for WPF to get the visual tree of the XamDataGrid, which will give you a better idea of what element you should retemplate or style.

    Hope this helps,

    Alex.