RadMaskedTextInput Validation problem

2 posts, 0 answers
  1. Sergey
    Sergey avatar
    4 posts
    Member since:
    Feb 2013

    Posted 10 Jun 2013 Link to this post

    Hello I have a problem with Radmaskedtextinput. If I make a new blank project everything works fine. But in my project validation does not work (. Maybe someone already faced with like. If I comment on their styles and styles are used by default, in my project, too, everything is working properly .... I even took a blend of styles with the default Radmaskedtextinput , but it still does not work if you are using the disclosed styles. basically I need only to remove the yellow edge hover and focus on the field. Can anyone tell me how to remove the border using Codebehind because the disclosure of style validation stops working.
    Sorry for my English.
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 13 Jun 2013 Link to this post

    Hello Sergey,

    As far as I understand your requirement you want to remove or change the "MouseOver" and "Focused" visual states of the RadMaskedTextInput control. In order to achieve your requirement you can extract and edit the default Template of the control (read more). When you do this you can find a VisualState called "MouseOver" and if you edit it like this:

    <VisualState x:Name="MouseOver">
        <Storyboard>
            <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlOuterBorder_MouseOver}" />
            </ObjectAnimationUsingKeyFrames>-->
            <DoubleAnimation Duration="0"
                             Storyboard.TargetName="ClearButton"
                             Storyboard.TargetProperty="Opacity"
                             To="1" />
        </Storyboard>
    </VisualState>
    You will disable the ObjectAnimation to change the BorderBrush to Yellow.

    Furthermore, you can see that in the "Focused" VisualState the Border called "FocusedVisual" is visualized. In order to make it identical to the default visual state you can edit it like this:

    <Border x:Name="FocusedVisual"
         BorderBrush="{TemplateBinding BorderBrush}"
         BorderThickness="1"
         CornerRadius="{StaticResource ControlOuterBorder_CornerRadius}"
         Visibility="Collapsed" />
    For your convenience I implemented this approach in the attached project. Please take a look at it and let me know if it fits your scenario.

    Regards,
    Pavel R. Pavlov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top