Prevent user from resizing columns with WPF ListView

后端 未结 5 1678
慢半拍i
慢半拍i 2020-12-06 04:27

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

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 05:03

    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

提交回复
热议问题