In my data, for each row, I need to show a list under Header 2 and Header 3. The number of elements in each list will differ. An example representation is shown below. Is it possible to achieve the following representation in a TreeGrid? If so how?
Header 1 | Header 2 | Header 3 |
------------------------------------------------------------------------
Row 1 | A | M |
| B | N |
| C | |
-------------------------------------------------------------------------
Row 2 | D | O |
| E | P |
| | Q |
Hello Viswanath,
Thank you for reaching out. I believe you would be better suited with the XamDataGrid instead of a TreeGrid if you are only concerned about displaying a list of items within a column structure as illustrated. I do recommend reviewing the DataTree's Configuring and Heterogeneous samples, since they are as close as you will be able to get your data to display in that format aside from possibly retemplating the control.
http://ko.infragistics.com/samples/wpf/tree-grid/configuringhttp://ko.infragistics.com/samples/wpf/tree-grid/heterogeneous-data
http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=xamTreeGrid_Binding_To_Data.html
Let me know if you have any questions regarding this matter.
The reason I went with TreeGrid instead of DataGrid is that I need a hierarchy to group the rows of data like it is shown under the "Name" column in the links you provided.
And, for each row, I need to display the data like I mentioned.
There is nothing built-into the grid that I am aware of, such as a layout, to give you the structure you seek.
You would need to configure your data, as an example, string, List<string,string> so that the data in the list would be treated as children together otherwise I believe you would end up with two collapsible nodes under Row1, one for header1 and one for header2. As far as having the top data for header2 and 3 in the top row, you may also be able to handle this by modifying your data so that it looks like string header1, string header2, string header3, List<string header2,string header3>.
Let me know if you have any questions.