While using a WPF DataGrid and a CheckBox column I realised that it was taking two Mouse clicks to change the state of the CheckBox.

I found a good post by Mike Borozdin which explains how to work around this ‘issue’;


Basically, if instead of adding a CheckBox column, you add a TemplateColumn, and enclose a CheckBox within the DataTemplate, this works around the ‘issue’;

<DataGrid Name="dgProducts" AutoGenerateColumns="False" CurrentCellChanged="dgProducts_CurrentCellChanged">


        <DataGridTextColumn Header="Name" Binding="{Binding Path=Name}"/>

        <DataGridTextColumn Header="Price" Binding="{Binding Path=Price}"/>

        <DataGridTemplateColumn Header="In Stock">



                    <CheckBox IsChecked="{Binding Path=IsInStock, UpdateSourceTrigger=PropertyChanged}">






By |2012-10-22T16:50:00+01:00October 22nd, 2012|.Net Framework, Bugs, WPF|0 Comments

About the Author:

Leave A Comment