I have a checkbox in my xaml which is bind to a property and even if the property is false, it is not making the checkbox disabled.
Here is the xaml:
<DataGridTemplateColumn Header="checkBox" Width="60">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=IsClickable}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
viewModel.cs
public bool IsClickable
{
get { return _isClickable; }
set { _isClickable = value;
PropertChanged("IsClickable");}
}
And I m setting this property at the time of object creation.
And im binding the datagrid using itemsource;
Datagrid.ItemsSource = ViewModels;
And I can see that the object collection of viewmodel does have that property populated as false.But is not disabling the checkbox.
Can some one tell me why please?
You’re binding the
IsCheckedproperty, but if you want to enable/disable theCheckBox, you need to bind theIsEnabledproperty:(you will probably need to bind
IsCheckedto something else, otherwise you won’t be able to retrieve the checked state)