WPF DataGrid: Binding DataGridColumn visibility to ContextMenu MenuItems IsChecked (MVVM)

后端 未结 6 630
不思量自难忘°
不思量自难忘° 2020-12-23 23:45

I want to control DataGrid column visibility through a ContextMenu available to the user by right-clicking the column header. The ContextMenu

6条回答
  •  旧巷少年郎
    2020-12-24 00:15

    I just wrote a blog post on this topic. It allows DataGridColumns to be shown or hidden through a ContextMenu that is accessible by right-clicking any column header. This task is accomplished purely through attached properties so it is MVVM-compliant.

    See blog post

提交回复
热议问题