【WPF】DataGrid 的CheckBox列单击不能选中,需要点击两次的问题

修改列的模板,不使用自带的CheckBox列

       <DataGridTemplateColumn Width="30">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsChecked, UpdateSourceTrigger=PropertyChanged}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
         </DataGridTemplateColumn>

binding的列可以自行修改。

posted on 2020-07-17 10:27  梦琪小生  阅读(1401)  评论(0编辑  收藏  举报

导航