ListView with grouping (In GridView mode)

ListView inherits GroupStyle from ItemsControl, so we can easily achieve grouping for GridView. The only thing we should provide is a GroupStyle. Besides, in order to collapse and expande a group, an Expander is added in the GroupStyle.

The number on the group header indicates the count of items in that group.

Declaimer: This posting is provided "AS IS" with no warranties, and confers no rights.


Comments (12)

  1. alex_simkin says:

    Well, Duh…

    No offence, but how about some data editing.

    For almost a year already I’m really enjoying the unlimited possibilities of data visualization in Avalon and absolutely no support for any kind of non-trivial (fill in the form) data editing.

    How about modifying your very first example by adding the ability to add/modify an entry without additional forms i.e. directly in the list?

    Styling of controls is pretty cool, but some of us concerned with the UI usability more than with cool effects. How about at least one tiny example of data entry with Accept/Reject, Undo/Redo, "Do you want to save your changes?" prompt, etc. in less than 2000 lines of code?

    Nothing personal, but should we really need to consider WPF for the next version of our business application or we are fine with Forms for the next 5 years? Are we getting anything except round buttons, fuzzy fonts and 3d windows?

  2. ATC Avalon Team says:

    Thanks Alex.

    As sorting and grouping are common scenarios of ListView and some customers asked for them, we post those samples. As for Editing, it is not ListView goal, but we will give a sample to help customer.

    However, those detailed features like data entry with Accept/Reject, Undo/Redo may not be considered in the sample, we will only give a general one and cusomter can add any feature if he likes.

    Of course, if you have any issue in addin your features to the sample, feel free to contact with us.  

  3. ATC Avalon Team says:

    There will a simple editable ListView sample posted in a few days.

  4. alex_simkin says:

    Please do not spend your time just to please me. It was a rhetorical question.

    Consider: Colors, Fonts, Grouping, Paging, Documents, Typography, 3D charts, … – what kind of application are we talking about? Report Generator? While reporting is a very respectful feature of any application, the more interactive experience with data entry is what our customers expect from us and that’s what we expect you – WPF architects – to help us with.

  5. ATC Avalon Team says:

    Alex, Editing sample is posted!

  6. Alec Cozens says:

    Very nice, except I don’t seem to get a vertical scroll bar – is that to be expected?

    Thanks, Alec

  7. ATC Avalon Team says:

    Alec, if you set the ListView.Height property as a value smaller than needed, a vertical scroll bar will appear automatically.

  8. Alec Cozens says:

    Many thanks. I was putting your code within a stack panel and expecting a scroll bar to appear. Changed it to a grid and it worked.

  9. cbCharles says:

    Hi I’m new to wpf..

    Is there a an example of a listview with paging capabilities ?

  10. IsisTheDamned says:

    Hello there,

    My application makes heavy use of the ListViews sorting, grouping and filtering functionallity. Now this works pretty fine for <100 items and then the ListView starts lagging to death. Even if the window containing the list is not displayed(Z-Ordered behind another window) or minimized to task bar it doesn’t get better.

    Meanwhile I know this is about some virtualized stack panel thing but I need the functionality.

    Is there a trick to get the panel virtualize again after it’s sorted/grouped so that at least the UI gets responsive again after the list has been sorted/grouped?



  11. wichan says:


    I’ve been trying to figure out how to move the group header from the top of the group to the left hand side of the group.  I know how to change the content of the group, but how do I move/transform it from a row to a column?



Skip to main content