Search code examples
wpfgridviewlistview

Prevent user from resizing columns with WPF ListView


How can I prevent a user from resizing GridViewColumns withing a ListView control?


Solution

  • i found a solution and probably it will help someone else someday ;)

    you have to override the GridViewColumnHeader's ControlTemplate (default template is here ) and remove the PART_HeaderGripper from the template in order to prevent resizing of your columns.

    there is another solution that comes up with subclassing GridViewColumn described here. for representation purposes i prefer xaml only solutions though