This is a migrated thread and some comments may be shown as answers.

MaskedTextInput, can not bind to Value

3 Answers 252 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Jeroen
Top achievements
Rank 1
Iron
Jeroen asked on 04 Jun 2019, 01:46 PM

Hello,

I Use version 2015.2.623.40

I've created a page containing several MaskedTextInput boxes. My concern is the  box RegNr.

I can't bind t the Value property of it from my ViewModel, it is always "" (empty string). The Text property works fine and passes it's value to my viewmodel

I want to clear the box after the user has saved, for that I need to set the Value property to NULL, correct?

I just replace the Text={Binding ... by Value={Binding ....

Below my XAML

<catel:DataWindow x:Class="ZMAdmin.Views.AddCustomerWindow" 
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
      xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  xmlns:catel="http://catel.codeplex.com" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
                  xmlns:fe="clr-namespace:ZMAdmin.ViewExtensions"             
  mc:Ignorable="d" 
  ResizeMode="CanMinimize" SizeToContent="WidthAndHeight"
      WindowStartupLocation="CenterOwner" WindowState="Normal" 
  Icon="/Resources/Graphics/Female32.png"
  d:DesignWidth="701" d:DesignHeight="583">

<!-- Resources -->
<catel:DataWindow.Resources>
<Style TargetType="telerik:RadMaskedTextInput">
<Setter Property="IsClearButtonVisible" Value="False" />
<Setter Property="SectionsNavigationMode" Value="None" />
<Setter Property="TextMode" Value="PlainText" />
<Setter Property="SelectionOnFocus" Value="CaretToBeginning" />
<Setter Property="AcceptsReturn" Value="False" />
</Style>
        <Style x:Key="FocusTextBox" TargetType="Grid">
            <Style.Triggers>
                <DataTrigger Binding="{Binding ElementName=RegNr, Path=IsVisible}" Value="True">
                    <Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=RegNr}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

<ControlTemplate x:Key="ValidationErrorTemplate">
<DockPanel>
<!--
<ImageSource="/Resources/Graphics/Exclamation16.png" Height="16" DockPanel.Dock="Right" Margin="2,0,0,0" 
ToolTip="{Binding ElementName=MyAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" />
-->
<Border BorderBrush="Red" BorderThickness="2" CornerRadius="4">
<AdornedElementPlaceholder Name="MyAdorner" />
</Border>
</DockPanel>
</ControlTemplate>

<Style TargetType="TextBox">
<Style.Setters>
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
</Style.Setters>
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true" >
<Setter Property="ToolTip">
<Setter.Value>
<Binding RelativeSource="{x:Static RelativeSource.Self}" Path="(Validation.Errors)[0].ErrorContent" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</catel:DataWindow.Resources>

    <catel:DataWindow.InputBindings>
        <KeyBinding Command="{Binding Path=CmdAccept}"
                    Key="O"
                    Modifiers="Alt"/>
    </catel:DataWindow.InputBindings>
<!-- Content -->
<telerik:RadTabControl Margin="0">
<telerik:RadTabItem>
<telerik:RadTabItem.Header>
<StackPanel Orientation="Horizontal" Background="SeaGreen">
<Image Source="/Resources/Graphics/Contract.png" Height="32" Margin="8,4,16,4"/>
<telerik:Label Content="Nieuw servicecontract" FontSize="14"  VerticalContentAlignment="Center"/>
</StackPanel>
</telerik:RadTabItem.Header>

            <catel:InfoBarMessageControl Text="De volgende invoerfouten zijn gevonden:" >

                <Grid x:Name="RootGrid" Margin="10,8,10,2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <!-- Klantnr  -->
                        <RowDefinition Height="Auto" />
                        <!-- NAAM -->
                        <RowDefinition Height="Auto" />
                        <!-- POSTCODE / PLAATS -->
                        <RowDefinition Height="Auto" />
                        <!-- TELEFOON -->
                        <RowDefinition Height="Auto" />
                        <!-- Contract tekst -->
                        <RowDefinition Height="Auto" />
                        <!-- Contract details -->
                        <RowDefinition Height="Auto" />
                        <!-- Comment -->
                        <RowDefinition Height="Auto" />
                        <!-- Telefoon/rekening in gebruik -->
                        <RowDefinition Height="Auto" />
                        <!-- Ok / close button -->
                    </Grid.RowDefinitions>

                    <catel:WarningAndErrorValidator Source="{Binding}" />

                    <!-- JAARLIJKS SERVICECONTRACT, ROW 0-->
                    <Grid x:Name="kosten" Grid.Row="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <telerik:Label Content="Persoonsgegevens" FontSize="14" Margin="0,0,12,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"   HorizontalAlignment="Center" VerticalContentAlignment="Bottom"/>
                        <Image Grid.Row="0"  Grid.Column="2" Source="/Resources/Graphics/Contract.png" HorizontalAlignment="Center" Height="45" />
                    </Grid>

                    <!-- NAAM, ROW 1  -->
                    <Grid x:Name="naam" Grid.Row="1" Margin="0,8,8,0" Style="{StaticResource FocusTextBox}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical">
                            <TextBlock Text="Klantnr." />
                            <!--                            <ControlTemplate.Triggers>
                                <Trigger Property="IsPressed" Value="true" >
                                    <Setter Property="TextBox" TargetName="TextBox" Value="Red"/>
                                </Trigger>
                            </ControlTemplate.Triggers>-->
                            <telerik:RadMaskedTextInput Placeholder=" "Width="100" HorizontalAlignment="Left" Mask="d7l1" 
                                                        Text="{Binding RegNr, Mode=TwoWay}" 
                                                        BorderThickness="2" BorderBrush="#FFC7C7C7" Name="RegNr" 
                                                        SectionsNavigationMode="None" InputBehavior="Replace" IsTabStop="False"                                                                                                                                                                                                                                                                                       
                                                        >
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdValidateRegNr}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                                <i:Interaction.Behaviors>
                                    <catel:Focus FocusMoment="Event" Source="{Binding ElementName=CmdAccept}" EventName="Click"/>
                                </i:Interaction.Behaviors>
                            </telerik:RadMaskedTextInput>
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="1" Margin="8,0,0,0" ToolTip="Contract is getekend door">
                            <TextBlock Text="Getekend" />
                            <telerik:RadComboBoxMinWidth="100" BorderThickness="2" HorizontalAlignment="Left" ItemsSource="{Binding SignedByList}"
IsEditable="False" IsReadOnly="True" IsTextSearchEnabled="True" AlternationCount="2"
SelectedValue="{Binding SignedBy, Mode=TwoWay, ValidatesOnDataErrors=True}"/>
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Achternaam" />
                            <TextBoxBorderThickness="2" MinWidth="160" Text="{Binding LastName, Mode=TwoWay, ValidatesOnDataErrors=True}" SelectionBrush="Black">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdValidateLastName}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="3" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Tussenv." />
                            <TextBoxBorderThickness="2" Text="{Binding LinkName, Mode=TwoWay}" MinWidth="100"/>

                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="4" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Initialen" />
                            <TextBox BorderThickness="2" MinWidth="80" Text="{Binding FirstName, Mode=TwoWay, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdValidateInitials}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                    </Grid>

                    <!-- POSTCODE -->
                    <Grid x:Name="Postalcode" Grid.Row="2" Margin="0,8,8,0" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical" >
                            <TextBlock Text="Postcode" />
                            <telerik:RadMaskedTextInput BorderThickness="2" Width="100" Margin="0 0 0 2" Mask="d4>l2" Value="{Binding PostalCode, Mode=TwoWay,ValidatesOnDataErrors=True}" BorderBrush="#FFC7C7C7">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdLookupStreets}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </telerik:RadMaskedTextInput>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Adres" />
                            <!--<TextBoxBorderThickness="2" Width="180" Text="{Binding Address,Mode=TwoWay, ValidatesOnDataErrors=True}" IsTabStop="False"/>-->
                            <telerik:RadComboBox BorderThickness="2" Width="180" ItemsSource="{Binding Streets,Mode=TwoWay, ValidatesOnDataErrors=True}" 
                                                 IsTextSearchEnabled="True" IsEditable="True"
                                                 Text="{Binding Address,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdLookupHousnrs}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </telerik:RadComboBox>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlock Text="Huisnr" />
                            <telerik:RadComboBox BorderThickness="2" MinWidth="60" ItemsSource="{Binding HouseNumbers,Mode=TwoWay, ValidatesOnDataErrors=True}" 
                                                 IsTextSearchEnabled="True" IsEditable="True"
                                                 Text="{Binding HouseNumber,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdLookupPC}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </telerik:RadComboBox>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="3" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Woonplaats" />
                            <TextBoxBorderThickness="2" Width="160" Text="{Binding City,Mode=TwoWay, ValidatesOnDataErrors=True}" IsTabStop="False" />
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="4" Margin="8,0,0,0">
                            <telerik:RadButton Margin="0,15,0,0" Command="{Binding CmdPostcodeWindow}" IsTabStop="False" ToolTip="Zoek postcode" >Zoek postcode</telerik:RadButton>
                        </StackPanel>
                    </Grid>


                    <!-- Telefoon, Email -->
                    <Grid x:Name="Communicatie" Grid.Row="3" Margin="0,8,8,0" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinitionWidth="Auto" />
                            <!-- Tel -->
                            <ColumnDefinitionWidth="Auto" />
                            <!-- Mob -->
                            <ColumnDefinitionWidth="Auto" />
                            <!-- Email -->
                        </Grid.ColumnDefinitions>

                        <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical" Margin="0">
                            <TextBlockText="Telefoon" />
                            <TextBoxBorderThickness="2" Width="100" Text="{Binding Telephone, Mode=TwoWay, ValidatesOnDataErrors=True}" >
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdValidateTelephone}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Mobiel" />
                            <TextBoxBorderThickness="2" Width="100" Text="{Binding Mobile, Mode=TwoWay, ValidatesOnDataErrors=True}" >
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdValidateMobile}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlockText="Email" />
                            <TextBoxBorderThickness="2" Width="310" Text="{Binding Email, Mode=TwoWay, ValidatesOnDataErrors=True}" >
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus" >
                                        <catel:EventToCommand Command="{Binding CmdValidateEmail}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                    </Grid>

                    <!-- Co0ntract text -->
                    <telerik:Label Grid.Row="4" Grid.Column="1" Content="Contractgegevens" FontSize="14" Margin="0,8,0,0" />

                    <!-- Contract details  (2 rows, 5 columns) -->
                    <Grid Grid.Row="5" Margin="0,8,8,8">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <StackPanel Orientation="Vertical" Grid.Row="0" Grid.Column="0" >
                            <TextBlock Text="Servicecontract" />
                            <telerik:RadComboBoxBorderThickness="2" MinWidth="180" HorizontalAlignment="Left" ItemsSource="{Binding ContractList}"  
IsEditable="False" IsReadOnly="True" IsTextSearchEnabled="True" AlternationCount="2" DisplayMemberPath="Name"
SelectedItem="{Binding ContractIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
/>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlock Text="Bedrag" />
                            <TextBox BorderThickness="2" Width="100" Text="{Binding ContractPayment, Mode=TwoWay, ValidatesOnDataErrors=True}" IsTabStop="False">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus" >
                                        <catel:EventToCommand Command="{Binding CmdValidatePayment}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical" Margin="8,0,0,0">
                            <TextBlock Text="RekeningNr" />
                            <TextBox BorderThickness="2" Width="100" Text="{Binding AccountNr, Mode=TwoWay, ValidatesOnDataErrors=True}" fe:FocusExtension.IsFocused="{Binding AccountNrFocused}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus" >
                                        <catel:EventToCommand Command="{Binding CmdValidateAccountNr}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="3" Orientation="Vertical" Margin="8,0,0,0" >
                            <TextBlock Text="IBAN" />
                            <TextBox BorderThickness="2" Width="100" Text="{Binding Iban, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsTabStop="False" />
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="4" Orientation="Vertical" Margin="8,0,0,0" >
                            <TextBlock Text="Bank" />
                            <telerik:RadComboBox BorderThickness="2" MinWidth="100" HorizontalAlignment="Left" ItemsSource="{Binding BicList}" 
IsEditable="False" IsReadOnly="False" IsTextSearchEnabled="True" AlternationCount="2"
                                                                        DisplayMemberPath="BankName"
SelectedValue="{Binding BicValue,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus" >
                                        <catel:EventToCommand Command="{Binding CmdValidateAccountNr}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </telerik:RadComboBox>
                        </StackPanel>

                        <StackPanel Grid.Row="0" Grid.Column="5" Orientation="Vertical" Margin="8,0,0,0" ToolTip="Betalingsweek en Startweek">
                            <TextBlock Text="Bet. Week" />
                            <TextBox BorderThickness="2" Width="60" Text="{Binding PayWeek, Mode=TwoWay, ValidatesOnDataErrors=True}" IsTabStop="False"/>
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="LostFocus" >
                                    <catel:EventToCommand Command="{Binding CmdValidatePayWeek}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </StackPanel>

                        <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" Margin="0,8,0,0">
                            <TextBlock Text="Woning" />
                            <telerik:RadComboBoxBorderThickness="2" MinWidth="180" HorizontalAlignment="Left" ItemsSource="{Binding OwnershipList}" IsTabStop="False"
IsEditable="False" IsReadOnly="True" IsTextSearchEnabled="True" AlternationCount="2" IsEnabled="True"
SelectedValue="{Binding Ownership, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
/>
                        </StackPanel>

                        <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" Margin="8,8,0,0">
                            <TextBlock Text="Klant Sinds" />
                            <TextBox BorderThickness="2" Width="100" Text="{Binding StartDate, Mode=TwoWay,ValidatesOnDataErrors=True}" fe:FocusExtension.IsFocused="{Binding StartDateFocused}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus" >
                                        <catel:EventToCommand Command="{Binding CmdValidateStartDate}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical" Margin="8,8,0,0">
                            <TextBlock Text="Jaar pas" />
                            <TextBox BorderThickness="2" Width="100" Text="{Binding CardYear, Mode=TwoWay, ValidatesOnDataErrors=True}" IsEnabled="False" IsTabStop="False">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <catel:EventToCommand Command="{Binding CmdValidateCardYear}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Grid.Column="3" Orientation="Vertical" Margin="8,8,0,0">
                            <TextBlock Text="Datum Pas" />
                            <TextBox BorderThickness="2" Width="100" Text="{Binding CardDate, Mode=TwoWay, ValidatesOnDataErrors=True}" IsTabStop="False">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus" >
                                        <catel:EventToCommand Command="{Binding CmdValidateCardDate}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Grid.Column="4" Orientation="Vertical" Margin="8,8,0,0">
                            <TextBlock Text="Werver" />
                            <StackPanel Orientation="Horizontal">
                                <telerik:RadComboBoxBorderThickness="2" MinWidth="100" HorizontalAlignment="Left" ItemsSource="{Binding RecruiterList}"
IsEditable="True" IsReadOnly="False" IsTextSearchEnabled="True" AlternationCount="2"
Text="{Binding RecruiterNr,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" >
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="LostFocus">
                                            <catel:EventToCommand Command="{Binding CmdValidateRecruiter}"/>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </telerik:RadComboBox>
                            </StackPanel>
                        </StackPanel>
                    </Grid>

                    <StackPanel Grid.Row="6" Orientation="Vertical"Margin="0,8,0,0" >
                        <TextBlock Text="Opmerkingen" />
                        <TextBox Text="{Binding Comments}" BorderThickness="2" Height="80" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
                    </StackPanel>

                    <StackPanel Grid.Row="7" Margin="4,4,4,0" Orientation="Vertical">
                        <TextBlock Text="{Binding ValidationString}"FontWeight="Bold" Visibility="{Binding ValidationVisibility}"Foreground="White" Background="Red"  />
                        <TextBlock Text="{Binding AccountText}"FontWeight="Bold" Visibility="{Binding AccountVisibility}"Foreground="White" Background="Red"  />
                        <TextBlock Text="{Binding PostalcodeText}"FontWeight="Bold" Visibility="{Binding PostalcodeVisibility}"Foreground="White" Background="Orange"  />
                        <TextBlock Text="{Binding TelephoneText}" FontWeight="Bold" Visibility="{Binding TelephoneVisibility}"Foreground="White" Background="Orange" />
                        <TextBlock Text="{Binding MobileText}"FontWeight="Bold" Visibility="{Binding MobileVisibility}"Foreground="White" Background="Orange" />
                        <TextBlock Text="{Binding EmailText}"FontWeight="Bold" Visibility="{Binding EmailVisibility}"Foreground="White" Background="Orange" />
                    </StackPanel>

                    <!-- OK/ ANNULEER BUTTONS -->
                    <StackPanel Grid.Row="8" Margin="4,4,4,4" Orientation="Horizontal" >
                        <telerik:RadButton Command="{Binding CmdAccept}" ToolTip="Sla gegevens op en voer volgende klant in" TabIndex="98" Name="CmdAccept" IsDefault="True">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="/Resources/Graphics/Accept16.png" Height="16" />
                                <telerik:Label Content="Opslaan" />
                            </StackPanel>
                        </telerik:RadButton>

                        <StackPanel Margin="24,0,0,0" Visibility="{Binding NotificationVisible}" Orientation="Horizontal" >
                            <StackPanel.Effect>
                                <DropShadowEffect ShadowDepth="2" />
                            </StackPanel.Effect>
                            <Image Source="/Resources/Graphics/Info16.png" Height="20"/>
                            <TextBlockText="Klant is toegevoegd!" Margin="8,0,0,0" VerticalAlignment="Center" FontWeight="Normal" FontSize="16" />
                        </StackPanel>

                        <StackPanel Orientation="Vertical" >
                            <TextBlock Foreground="Red" Text="Rood:     Foutmelding" Margin="8,0,0,0"/>
                            <TextBlock Foreground="Orange" Text="Oranje:   Waarschuwing" Margin="8,0,0,0"/>
                        </StackPanel>

                    </StackPanel>
                </Grid>

            </catel:InfoBarMessageControl>

        </telerik:RadTabItem>
</telerik:RadTabControl>
</catel:DataWindow>

Thanks for helping

 

Jeroen

3 Answers, 1 is accepted

Sort by
0
Jeroen
Top achievements
Rank 1
Iron
answered on 04 Jun 2019, 02:10 PM

After stripping the MaskedTextInput I've found that the Mask property is the cause.

 

Is that as expected?

 

Jeroen

0
Vladimir Stoyanov
Telerik team
answered on 07 Jun 2019, 10:10 AM
Hello Jeroen,

Thank you for the provided code snippet. 

I tried to isolate the described behavior in a sample project, however I was not able to do so. That is why I am attaching the sample project, which I used for testing purposes. On my end, the bound property is updated once all of the required digits are entered. Note, that this is default behavior for required mask tokens.

If you want the bound property to be updated on each key stroke, you can set the AllowInvalidValues property of the RadMaskedTextInput to True. Please, give this a try and let me know, if that is what you were going for. 

Should you need any further assistance, may I kindly ask you to modify the sample project in order to represent the observed on your end result and elaborate on the desired requirements? You can send the ticket over in a new support ticket (since projects cannot be attached to forum posts) and I will investigate it.

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jeroen
Top achievements
Rank 1
Iron
answered on 07 Jun 2019, 11:32 AM

Thanks so much,

 

the AllowInvalidValues option did the trick.

 

Jeroen

Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Jeroen
Top achievements
Rank 1
Iron
Answers by
Jeroen
Top achievements
Rank 1
Iron
Vladimir Stoyanov
Telerik team
Share this question
or