Telerik Forums
UI for WPF Forum
1 answer
26 views

Hello,

I'm using a RadMaskedTextInput and I'm wondering if it's possible to change the foreground color of just the placeholders?

What I'm trying to accomplish is for every X in below image to appear in a brighter color than the text typed in by the user.

What my RadMaskedTextInput looks like currently:

What I want the foreground to look like:

Stenly
Telerik team
 answered on 25 Mar 2024
1 answer
60 views

Hi,

Would it be possible to have an editable RadMasked Part to mimic the RadWatermarkTextBox with floating Label?

Stenly
Telerik team
 answered on 31 Oct 2023
1 answer
105 views

Hello,

 

I have a RadMaskedTextInput that I'm using for a phone number.

 

If I clear the form, and set the txtDriverNumber (that's the name of the field) using txtDriverNumber.Text = "" (and I also tried string.Empty) it looks like it clears the value correctly.


However, when the textbox gets focus again, it puts back in the last entered data.  I don't want it to do that, is there something I can do to make sure it doesn't remember previous values?

Stenly
Telerik team
 answered on 06 Jul 2023
1 answer
65 views

Hi,

I an using RadMaskedCurrencyInput control for taking number from input its work fine for using English Keyboard. The problem is when I change the system language to Japanese and enter number using NumPad, instead of new value replace with entered one, new value is concatenate with previous value. Like if 415 is already entered, I switch the Keyboard to Japanese  and select the previous entered value and type new number 325, Predication window is open and choose the number 325. After's electing value, our RadMaskedCurrencyInput  shows 325415 value instead of 325.
Please help me to resolve this.


Thanks in Advance.

Dilyan Traykov
Telerik team
 answered on 22 Aug 2022
1 answer
192 views

Hello!

I'm working with the RadMaskedNumericInput for the first time (first time using masked inputs at all) and am in need of advice. I want to have the control's value be set to a default value if the user were to clear the control's input, then remove the focus.

I have the control set up like so:

<telerik:RadMaskedNumericInput x:Name="txtDaysValid" Width="30" Value="30"
                               Mask="d2" TextMode="PlainText" InputBehavior="Insert"
                               maskedInput:MaskedInputExtensions.Minimum="1"
                               UpdateValueEvent="LostFocus"
                               LostFocus="txtDaysValid_LostFocus"/>

And the event handler is:

var numericInput = sender as RadMaskedNumericInput;

if (string.IsNullOrWhiteSpace(numericInput.Text))
{
    numericInput.Value = 30;
    numericInput.Text = numericInput.Value.ToString();
}

This is the behaviour I'm currently experiencing:

  • Control Reads 30 -> User sets blank -> Control Reads blank (incorrect)
  • Control Reads 30 -> User sets to 12 -> Control Reads 12 -> User sets blank -> Control reads 30 (correct)
  • Control Reads 30 -> User sets to 12 -> Control Reads 12 -> User sets blank -> Control reads 30 -> User sets blank -> Control reads blank (incorrect)
  • Control Reads Blank -> User sets to 1 -> Control Reads 1 -> User sets blank -> Control Reads blank (incorrect)
  • Control Reads Blank -> User sets to 21 -> Control Reads 21 -> User sets blank -> Control Reads 30 (correct)

What am I missing here? It appears that updating the value and text directly only works in some cases. Is there a better approach to ensuring that when the user clears the input's field, that it defaults to a specific value upon losing focus?

Thanks!

Stenly
Telerik team
 answered on 27 Dec 2021
1 answer
94 views

I'm using Implicit Styles with the NoXaml dlls (Office_Black) theme to change the look of the RadMaskedDateTimeInput. 

I'd like to know how to set the BorderBrush of the control when hovering the mouse.

 

Thank you

 

 
Stenly
Telerik team
 answered on 03 Dec 2021
1 answer
141 views

Hi,

I tried to use a RadMasketTextInput instead of a standard TextBox, mainly because of the SelectionOnFocus/Selectall property.
Always wotks well, but the width of control doesn't use all the space left in the parent as a TextBox, in the same position, does.
I tried with stackpanel, dockpanel and Grid, this is the attempt with dockpanel:


<DockPanel Grid.Row="0" Grid.Column="0" Margin="12,0,0,0" HorizontalAlignment="Stretch">
				<Label VerticalAlignment="Center" 
Content="{DynamicResource  ResourceKey={x:Static r:ResourcesKeys.NameLabel}}" />
	<t:RadMaskedTextInput 
	  HorizontalAlignment="Stretch"
	 SelectionOnFocus="SelectAll"
         Value="{Binding SorgenteName}"/>			
</DockPanel>

And with textbox:

<DockPanel Grid.Row="0" Grid.Column="0" Margin="12,0,0,0" HorizontalAlignment="Stretch">
				<Label VerticalAlignment="Center" 
				    Content="{DynamicResource  ResourceKey={x:Static r:ResourcesKeys.NameLabel}}" />
				<TextBox 
									  HorizontalAlignment="Stretch"
							Text="{Binding SorgenteName}"/>
			</DockPanel>

With textbox I have the desired layout.

Thank you in advance

Stenly
Telerik team
 answered on 23 Sep 2021
1 answer
81 views

Hi Telerik Team,

I have some few question regarding telerik:RadMaskedDateTimeInput Control

telerik:RadMaskedDateTimeInput:
I have a telerik:RadMaskedDateTimeInput Control which has a default date as 08/09/21. We want to change the date to 31/10/2021.
When the user enters 31 in the date field, the control is taking the month into consideration and changing the date automatically to 30 since there is no 31 in the month of September
So first I have to change the month field and then date field to get the new proposed date 31/10/2021.
Any Possibility to change the behaviour.

The property I have used is 
        <telerik:RadMaskedDateTimeInput
          Culture="{x:Static globalization:CultureInfo.InvariantCulture}"
          DataContext="{Binding Path=UiArrivalDateObject, Mode=TwoWay}"
          FontSize="10"
          InputBehavior="Replace"
          IsClearButtonVisible="False"
          Mask="dd/MM/yy HH:mm"
          PreviewKeyDown="RadMaskedDateTimeInput_PreviewKeyDown"
          SectionsNavigationMode="Cycle"
          SelectionOnFocus="CaretToBeginning"
          TextMode="PlainText"
          UpdateValueEvent="PropertyChanged"
          Value="{Binding Path=LiveDateBerth, Mode=TwoWay, UpdateSourceTrigger=LostFocus, Converter={StaticResource DateTimeOffsetToDateTimeConverter}}">
</telerik:RadMaskedDateTimeInput>

Thanks In Advance
Regards,
Kishore Kumar

                          
Dinko | Tech Support Engineer
Telerik team
 answered on 14 Sep 2021
5 answers
117 views

Hello,

I have a problem with the RadMaskedTextInput-Control.

When I set the UpdateValueEvent-Property to LostFocus, then the input isn't converted to UpperCase anymore.

 

My xaml looks like this:

<telerik:RadMaskedTextInput Width="140" Height="22"
                            IsClearButtonVisible="False"
                            InputBehavior="Replace"
                            Mask=">X8"
                            SelectionOnFocus="Unchanged"
                            TextMode="MaskedText"
                            UpdateValueEvent="LostFocus"
                            Value="affeaffe"/>

 

I defined a ValidationRule to allow only Hex-Value for Input:

public class HexToken : ITokenValidationRule
    {
        public bool IsRequired
        {
            get { return false; }
        }
        public bool IsValid(char ch)
        {
            return ValidChars.Contains(ch);
        }
        public char Token
        {
            get { return 'X'; }
        }
        public TokenTypes Type
        {
            get { return TokenTypes.AlphaNumeric; }
        }
        private string myValidChars = "0123456789abcdefABCDEF";
        public string ValidChars
        {
            get { return myValidChars; }
        }
    }

 

Can you help me with this plz?

regards,

Tobias

Dilyan Traykov
Telerik team
 answered on 09 Mar 2021
6 answers
1.9K+ views

Hi,

I have this very simple style for my RadMaskedNumericInput control

<Style TargetType="telerik:RadMaskedNumericInput">
    <Setter Property="SelectionOnFocus" Value="SelectAll"/>
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="True">
            <Setter Property="Background" Value="Green"/>
        </Trigger>
        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background" Value="Red"/>
        </Trigger>
        <Trigger Property="IsFocused" Value="True">
            <Setter Property="Background" Value="Yellow"/>
        </Trigger>
        <Trigger Property="IsReadOnly" Value="True">
            <Setter Property="Background" Value="Gray"/>
        </Trigger>
    </Style.Triggers>
</Style>

 

Everything works fine except when the control receives focus, the background color does not change (remains green).  How come ?

Kind Regards,
Hans

Hans
Top achievements
Rank 1
Veteran
 answered on 11 Jan 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?