Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataGridCheckBoxColumn immediate binding

I'm using the WPF Toolkit Datagrid and have one column which is a DataGridCheckBoxColumn bound to a bool property on my ViewModel.

My problem is that I wan't the property to get it's value updated immediately when the user checks or unchecks the checkbox.

Now you have to navigate away from the cell in order to have the property updated. It's a checkbox. It can't be in the middle of editing like a textbox can.

like image 532
Johan Zell Avatar asked Mar 29 '10 10:03

Johan Zell


1 Answers

You have to set the UpdateSourceTrigger property of the Binding to PropertyChanged. The default is LostFocus.

like image 92
Timores Avatar answered Oct 28 '22 04:10

Timores