Hi I have a DataGridCheckBoxColumn and I want it to notifypropertychanged on the underlying bound object as soon as the user checks or unchecks the DataGridCheckBoxColumn.
At present it only appears to do this when the user clicks onto a different row after checking or unchecking the DataGridCheckBoxColumn.
XAML:
<DataGridCheckBoxColumn x:Name="isVisibleColumn" Binding="{Binding Path=isVisible}" Header="is Visible" Width="SizeToHeader" />
Code behind:
public bool isVisible
{
get
{
if (this.Visibility1 == Visibility.Visible)
{
return true;
}
else
{
return false;
}
}
set
{
if (value == true)
{
this.Visibility1 = Visibility.Visible;
}
else
{
this.Visibility1 = Visibility.Collapsed;
}
this.NotifyPropertyChanged("isVisible");
}
}
Change the UpdateSourceTrigger of the binding to propertychanged rather than leave the default of lostfocus
You will have to specify this by using a column template instead of a checkbox column