I have the following....
<igDP:FieldSettings
x:Key="PayDateFieldSettings" CellClickAction="SelectRecord"AllowEdit="True"
LabelTextAlignment="Center"
LabelTextWrapping="WrapWithOverflow"
EditAsType="{x:Type System:DateTime}"
ExcelExporter:DataPresenterExcelExporter.ExcelLabelFormatSettings ="{StaticResource ExcelLabelSettings}"
ExcelExporter:DataPresenterExcelExporter.ExcelCellFormatSettings ="{StaticResource ExcelRightCellSettings}">
<igDP:FieldSettings.EditorStyle>
<Style TargetType="igEditors:XamDateTimeEditor">
<Setter Property="Format" Value="{x:Static Constants:DateTimeFormats.FormatDateShort}" />
<Setter Property="IsEnabled" Value="{Binding DataItem.HasEntitlement}"/>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="ValueConstraint">
<Setter.Value>
<igEditors:ValueConstraint MinInclusive="{Binding DataItem.ExDate.Value, Mode=OneWay}" />
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.EditorStyle>
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}" BasedOn="{StaticResource CenterAlignedCellValuePresenterStyle}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataItem.PayDate.IsValueOverriden}" Value="True" /></MultiDataTrigger.Conditions><MultiDataTrigger.Setters>
<Setter Property="Background" Value="{DynamicResource CellOverrideBackground}" /></MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
and the field in the grid is
<igDP:UnboundField Binding="{Binding PayDate.Value, Mode=TwoWay,Converter={StaticResource _converterDate}}" Label="Pay Date" Settings="{StaticResource PayDateFieldSettings}"> </igDP:UnboundField>
However I get the following error...
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=DataItem.ExDate.Value; DataItem=null; target element is 'ValueConstraint' (HashCode=22098140); target property is 'MinInclusive' (type 'Object')
Got it working.
thanks
Do you have a sample app showing this
Hello,
You cannot bind the ValueConstraint object as it is not in the visual tree of the XamDataGrid and it will never find the appropriate ancestor. A solution is provided here.