Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 868 Bytes

File metadata and controls

13 lines (9 loc) · 868 Bytes

HeaderPersister is a small utility class that persist the header of individual GroupItems while scrolling. It is not tied to any particular ItemsControl derived class, I confirmed a correct behavior for ListBox, ListView and TreeView.

header-persister

Usage

The usage of the HeaderPersister is straightforward, make sure to:

  • Bind to your CollectionViewSource instance and define your GroupDescriptions collection.
  • Set the attached property HeaderPersister.IsEnabled to true.
  • Duplicate the visual tree of the GroupItem header in the HeaderPersister.HeaderTemplate attached property.

For more information, check the following blog post: http://blog.qarim.net/2013/08/16/wpf-persistent-group-headers-for-the-listbox-control/