I\'m really hoping someone can help me out here. I have a DataGrid in my program that has a checkbox column. The ItemsSource for the DataGrid is a DataSet loaded programmati
You're running into item container recycling. See http://blogs.msdn.com/b/vinsibal/archive/2008/05/14/recycling-that-item-container.aspx. WPF is re-using the row objects as you scroll, and you're seeing the Checked and Unchecked events fire as it binds to a different row.
If you want to stick with your current solution, you can just disable item container recycling
by adding VirtualizingStackPanel.VirtualizationMode="Standard"
to your dtgrd:DataGrid
element. You could also disable virtualization entirely by adding VirtualizingStackPanel.IsVirtualizing="False"
.
A better design might be to get that data from your underlying data model rather than relying on the UI events. Try handling the DataTable.ColumnChanged event on the DataTable.