Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is there a WPF control that can (maybe with a sprinkling of code) be used to display tabular data but split into sections?

Something like this: http://ilaajonline.com/j/2019/07/annual-household-expenses-spreadsheet-monthly-worksheet-india-daily-sample-free-download-bills-expense-budgeting-uk-example-budget-shared-business-income-best.jpg[^]

What I have tried:

I've tried an hour of searching and reading but still haven't got a workable way forward. I really don't want to pick the wrong 'base' control to start this work, when choosing more wisely would simplify my code.

I think the closest idea I have come across so far is to adjust my data in the view-model so that it has a two-level hierarchy and then use a TreeView to display this, fixing the nodes so that they are always expanded.

I have also just come across this: How to: Group, sort, and filter Data in the DataGrid control | Microsoft Docs[^]

It looks like it should do what I want. I just need a day to understand exactly what it's doing.
Posted
Updated 14-Oct-19 0:51am
v2
Comments
Afzaal Ahmad Zeeshan 14-Oct-19 5:59am    
That is not a section, merely a background color for a row. You can add a background color to the row almost in any way—data binding, hardcoding, storing the row color in the database.
Patrick Skelton 14-Oct-19 6:03am    
I chose the screenshot simply to illustrate roughly what I want to achieve. But there is different behaviour for each row. The coloured titles cannot, for example, be edited in the same way as the individual costed items. You could, if you wanted, implement my example image as a two-level tree. I'd argue that these items are, therefore, organised into sections.

1 solution

 
Share this answer
 

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