In the ListView declaration, I have changed the display to a list rather than the table for convenience. The ListView declaration is below.
I have also added a method AddHeader() as the first item within the Item Template. This method will add a list item that will be marked as the group identifier for the data. Here's the backend code for AddHeader() method. It's quite simple. It's important to note that updates the header property when the range changes and will only outputs the list item when there is a change.
I have also added css for styling and you can modify it as you see fit. Here's the css and the display when the code is run.
Here is the full code from code-behind in case you haven’t read my previous post.