WPF设置dataGrid checkBox列的样式

 <DataGridCheckBoxColumn Header="选择">
                            <DataGridCheckBoxColumn.HeaderTemplate>
                                <DataTemplate>
                                    <CheckBox x:Name="ckbSelectedAll" Content="全选" Checked="ckbSelectedAll_Checked" Unchecked="ckbSelectedAll_Unchecked" IsChecked="False"  />
                                </DataTemplate>
                            </DataGridCheckBoxColumn.HeaderTemplate>
                            <DataGridCheckBoxColumn.ElementStyle>
                                <Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}"/>
                            </DataGridCheckBoxColumn.ElementStyle>
                        </DataGridCheckBoxColumn>

 

posted @ 2020-05-27 09:41  _York  阅读(100)  评论(0编辑  收藏