Hi,
I am trying to change DisplayText of XamNumericEditor on a certain condition. But, DataTrigger never fires. In below mentioned code, background color is changing. But, converter set on ValueToDisplayTextConverter is not getting called. Having said that, converter gets called when I exit from edit mode. I want the datatrigger to fire when value is displayed for the first time.
Have attached complete sample for your reference.
<igDP:UnboundField BindingPath="Price" BindingMode="TwoWay" Label="Ps Px" Name="PosInsidePx">
<igDP:Field.Settings>
<igDP:FieldSettings EditAsType="{x:Type System:Double}" >
<igDP:FieldSettings.EditorStyle>
<Style TargetType="igED:XamNumericEditor">
<Setter Property="Format" Value="###,##0.0" />
<Setter Property="Mask" Value="{}{double:-9.3}" />
<Setter Property="HorizontalContentAlignment" Value="Right"/>
<!--<Setter Property="ValueToDisplayTextConverter" Value="{StaticResource DecimalToTicksConverter}"/>-->
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.IsMuniType}" Value="False">
<Setter Property="Background" Value="Aqua"/>
<Setter Property="ValueToDisplayTextConverter" Value="{StaticResource DecimalToTicksConverter}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:UnboundField>
Thanks,
Durga
Hello Druga,
Thank you for your post.
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well.
Please do not hesitate to let me know if you have any further questions on this matter.
Thanks. This is the approach we took since ValueToDisplayTextConverter does not work well with DataTriggers.
Why you don't using MultiValueConverter to achieve it?
e.g:
<igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="Text"> <Setter.Value> <MultiBinding Converter="{StaticResource XXXXConverter}"> <Binding Path="DataItem.IsMuniType"/> <Binding Path="DataItem.Price"/> </MultiBinding> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.EditorStyle>
Can some one please help me with this issue ?.