Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to display tree values in datagrid in C#
for eg:

Sample1
   - CH1
   - Ch2
          -PH1
          -PH2
          -PH3
   - Ch3
          -PH1
          -PH2
          -PH3


As of now i am able to display ch2 and ch3 but not able to display ch1 in datagrid in wpf.

What I have tried:

I am not getting any idea to resolve it.Please help me out.
Posted
Updated 9-Apr-20 1:02am
v2
Comments
Maciej Los 9-Apr-20 6:11am    
Use TreeView instead of datagrid.

1 solution

Please, take a look at this CP article: WPF TreeGrid using a DataGrid[^]

This might also be interesting: Displaying hierarchical data in the DataGrid[^]. Project files are available to download here: here (TreeGridApp.zip)[^]

And on SO: wpf - Handle editable hierarchical data / TreeView~DataGrid hybrid - Stack Overflow[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900