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

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

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

binding的列可以自行修改。

原文地址:https://www.cnblogs.com/mqxs/p/13328382.html