I am trying to bind command like below for a checkbox present in RadGridView's Column Header.
<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected, Mode=TwoWay}" Width="85" AutoSelectOnEdit="True" EditTriggers="CellClick">
<telerik:GridViewCheckBoxColumn.Header>
<CheckBox Command="{Binding ShowAllInDTCClickedCommand}" Content="Sh">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding ShowAllInDTCCheckedCommand}"/>
</i:EventTrigger>
<i:EventTrigger EventName="Unchecked">
<i:InvokeCommandAction Command="{Binding ShowAllInDTCUncheckedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</CheckBox>
</telerik:GridViewCheckBoxColumn.Header>
</telerik:GridViewCheckBoxColumn>
And trying to implement them in ViewModel like below.
public DelegateCommand ShowAllInDTClickedCommand { get; set; }
public DelegateCommand ShowAllInDTCCheckedCommand { get; set; }
public DelegateCommand ShowAllInDTCUncheckedCommand { get; set; }
ShowAllInDTClickedCommand = new DelegateCommand(ShowAllInDTClicked);
ShowAllInDTCCheckedCommand = new DelegateCommand(ShowAllInDTCChecked);
ShowAllInDTCUncheckedCommand = new DelegateCommand(ShowAllInDTCUnchecked);
private void ShowAllInDTClicked()
{
//Do Something
}
private void ShowAllInDTCChecked()
{
//Do Something
}
private void ShowAllInDTCUnchecked()
{
//Do Something
}
But these commands are not executing i.e. code is not reachable at all. What I am missing?