Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
490
xameditor not providing compile error or error when data is set with invalid value on a xammaskeditor (date) with invalid date value
posted

xameditor not providing compile error or error when data is set with invalid value on a xammaskeditor (date) with invalid date value:
however, it gives the error if I edit it.
Is there a flag to trigger error that will make to fail to set an invalid value?
the following doesn't give a error
<igxEditor:XamMaskedEditor Height="21.277" Margin="77,0,181,137" Name="xamMaskedEditor4" VerticalAlignment="Bottom" Mask="{}{date}" Value="02302008"/>
<igxEditor:XamMaskedEditor Height="21.277" Margin="77,0,181,137" Name="xamMaskedEditor5" VerticalAlignment="Bottom" Mask="{}{date}" Value="02292009"/>

However, the same gives error if I enter the same values.
thanks

  • 2070
    posted

    Hi,

     

    When you set the value in code, the user doesn't get prompted for invalid value. This is intended behavior. However you can check if the value is invalid by checking the editor's IsValueValid property. Here's an example of code style that changes the background of the editor based on whether the value inside is valid or not. Put it inside the window that contains editors.

     

        <Window.Resources>
            <Style x:Key="{x:Type igEditors:XamMaskedEditor}"  TargetType="{x:Type igEditors:XamMaskedEditor}">
                <Style.Triggers>
                    <Trigger Property="IsValueValid" Value="False">
                        <Setter Property="Background" Value="Orange" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Window.Resources>

     

    Hope this helps,

    Sandip