My app have a DataGridCheckBoxColumn where the header is a checkbox. I am trying to Achieve the following functionalities:
- when user checks the header checkbox the whole column should be checked.
- when user uncheck the column header the whole DataGridCheckBoxColumn should be unchecked.
- when whole column is checked and user unchecks one single cell the header should also get unchecked.
Is it possible to achieve this functionality with out writing code behind?
Here is my code which i use to create the DataGridCheckbox column
<DataGridCheckBoxColumn
Binding="{Binding Path=IsSelected,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ElementStyle="{StaticResource DataGridCheckBoxStyle}" >
<DataGridCheckBoxColumn.Header>
<CheckBox
IsChecked="{Binding Path=Data.AllItemsSelected, Source={StaticResource proxy}}"
IsEnabled="{Binding Path=IsBusy, Converter={StaticResource BooleanNotConverter}}" />
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
Thanks in advance