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
860
How to set the error message in xamMaskedInput
posted

I have the following:

<StackPanel Grid.Row="3" Orientation="Horizontal">
            <Label Width="80" Content="Phone:"/>
            <ig:XamMaskedInput Width="100" Text="{Binding PhoneNumber}" Mask="(###) ###-####" InvalidValueBehavior="DisplayErrorMessage"/>
  </StackPanel>

I would like to know how to set the error message to display.

Thanks.

Parents
No Data
Reply
  • 40
    posted

    i used this for IP validation

    xaml:

    <ige:XamMaskedInput Text="{Binding Value,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" x:Name="maskedEditor" InvalidValueBehavior="DisplayErrorMessageAndRevertValue" ValidationError="MaskedEditor_OnValidationError" Mask="{}{number:1-223}.{number:0-255}.{number:0-255}.{number:0-255}"/>

    CodeBehind:

    private void MaskedEditor_OnValidationError(object sender, EditModeValidationErrorEventArgs e)

    {

    e.ErrorMessage = "0 is not a valid entry, please specify a value between 1 and 223";

    }

Children
No Data