DataGridCheckBoxColumn loses IsReadOnly state when applying ElementStyle

后端 未结 2 1495
孤街浪徒
孤街浪徒 2021-01-18 08:01

I need to vertically center a DataGridCheckBoxColumn. Since I did not find a Property inside DataGridCheckBoxColumn, I applied an ElementStyl

2条回答
  •  独厮守ぢ
    2021-01-18 08:37

    When you set ElementStyle on the DataGridCheckBoxColumn you should include FrameworkElement.IsHitTestVisible="False" to your Style:

    
    

    Also if you add TargetType="CheckBox" to the Style then you don't have to repeat FrameworkElement for each Setter anymore:

    
        
    
    

提交回复
热议问题