I'm binding my xamDataGrid with entity class. All of my xamDataGrid's columns are UnboundFields. One of the field's contain checkbox and is binded to one of the datasource's field.
This field is defined like this:
<igDP:UnboundField Name="ReportSelector" Label=" " Column="0" BindingPath="IsSelected" BindingMode="TwoWay">
<igDP:UnboundField.Settings>
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource CheckboxSelectField}" CellMinWidth="20" LabelWidth="20" CellMaxWidth="20" LabelMaxWidth="20"/>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
And I override its CellValuePresenterStyle with style named CheckboxSelectField. This style is defined like this:
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="CheckboxSelectField">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<CheckBox Name="checkBoxRowSelector" Style="{StaticResource EnableMeetingMaterialsCheckBoxStyle}"
Checked="checkBoxRowSelector_Checked" Unchecked="checkBoxRowSelector_Unchecked"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The CheckboxSelectField has a style for the checkbox which is defined below. My checkbox is bindign to another field in my datasource different from the BindingPath set from the UnboundField.
<Style x:Key="EnableMeetingMaterialsCheckBoxStyle" TargetType="{x:Type CheckBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=FileStatus}" Value="2">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=FileStatus}" Value="4">
<DataTrigger Binding="{Binding Path= FileStatus}" Value="0">
<Setter Property="IsEnabled" Value="True" />
<DataTrigger Binding="{Binding Path= FileStatus}" Value="1">
<DataTrigger Binding="{Binding Path= FileStatus}" Value="3">
</Style.Triggers>
This is not working :( :( :( I really need your immediate help for this. Thank you very much.
I have found a solution.
instead of :
it should be:
<DataTrigger Binding="{Binding Path=DataItem.FileStatus}" Value="2">