Telerik Forums
UI for WPF Forum
0 answers
6 views

I have a RadMaskedNumericInput as follows:

 


<telerik:RadMaskedNumericInput Grid.Row="0" Grid.Column="1" Width="55"
                       Mask=""
                       FormatString="n2"
                       Value="{Binding TotalFeedVolume}"
                       IsClearButtonVisible="False"
/>

When I click on the left of the initial zero, it moves my cursor right in front of the decimal point. This is a bit frustrating, as I couldn't, for example, just easily make it "10" with one keystroke. Any way to fix this?

Zack
Top achievements
Rank 1
 asked on 09 Jul 2025
0 answers
9 views

Is there a property I can set so that the RadMaskedNumericInput field only shows the thousands separator when the value gets over 1,000? It doesn't look great that the commas appear before the value is high enough to need them.

Shawn
Top achievements
Rank 1
Iron
Iron
 asked on 30 Jun 2025
1 answer
585 views

Is there a control in WPF that I can use for numeric input that looks just like a textbox, but doesn't allow anything non-numeric?  I've looked at "Masked Input", and don't like the look nor the behavior (e.g. I don't like to see the template, and putting the curser at the beginning of field and hitting a number puts the number in the first digit and fills the rest with zeroes - nothing like a TextBox).  I've also looked at the "Numeric UpDown", but haven't found a simple example that looks like a TextBox - all the examples show with the up and down arrows, which I don't want.  I'm sure it's just a matter of formatting/templating/whatever, but I'm not a UI guy - I just want to drop the control on my form and maybe tweak a few parameters.

I would just use a TextBox bound to an integer, but the problem with that is if the user enters something non-numeric, a conversion exception is thrown, rather than a validation error.  At that point the form validates just fine because the backing field hasn't actually changed yet, so the user can, for example, hit [Save] while there are errors shown on the screen, and the [Save] logic thinks all is well.

Any ideas?

Thanks!

Brad.

1 answer
85 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
107 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
0 answers
82 views

Sometimes when I paste a test intro en empty RadMaskedTextInput, the application crushes and the following error occurs:

 

FATAL Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

                at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteNoMask(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteOverride(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedInputBase.HandlePaste()

   at Telerik.Windows.Controls.RadMaskedInputBase.OnApplicationPaste(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)

   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)

   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)

   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.InputManager.ProcessStagingArea()

   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


1 answer
273 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
0 answers
108 views

Hi Telerik Team,

We are using RadMaskedCurrencyInput inside RadGridView as RowDetailTemplate. But the performance is very poor, as it takes nearly 100 milliseconds for each number typing.

Also, it takes 2 to 4 seconds when we perform Select All and typing the number.

This happens only if the control is placed inside the RadGridView.

We have the same control outside the RadGridView for testing purpose which performs good.

Please let me know if any optimization can be done with this.

Below are the code we are using.

<tk:RadMaskedCurrencyInput

                    maskedInput:MaskedInputExtensions.MaxTextLength="5"

                    maskedInput:MaskedInputExtensions.Minimum="0"

                    FontSize="12"

                    FontWeight="DemiBold"

                    IsCurrencySymbolVisible="False"

                    Mask=""

                    SpinMode="None"

                    TextMode="PlainText" />

 

I'm not able to attach the video file here.
Thank You.

Premkumar
Top achievements
Rank 1
Iron
Iron
 asked on 02 May 2023
0 answers
81 views

I have this property

private double? _netFreqValue;
public double? NetFreqValue
{
    get => _netFreqValue;
    set
    { 
        if(_netFreqValue == value) return;
        _netFreqValue = value;
        this.OnPropertyChanged();
    }
}

and im trying to set the EmptyContent property to nothing(empty string) when the value is null

this works fine

<RadMaskedNumericInput
    Mask = "#4.3"
    AllowInvalidValues = "False"
    EmptyContent = ""
    UpdateValueEvent = "LostFocus"
    Value = "{Binding NetFreqValue, Mode=TwoWay, UpdateSourceTrigger = PropertyChanged}" />

but this does not

<RadMaskedNumericInput

    Mask = "#4.3"
    AllowInvalidValues = "False"
    EmptyContent = ""
    UpdateValueEvent = "LostFocus">
    <RadMaskedNumericInput.Value>
        <Binding Path=""NetFreqValue"
                         UpdateSourceTrigger="PropertyChanged"
                          Mode="TwoWay">
            <Binding.ValidationRules>
              //some validations
             </Binding.ValidationRules>
        </Binding>
      </RadMaskedNumericInput.Value>
</RadMaskedNumericInput>

how can i solve it?
thanks
ofir
Top achievements
Rank 1
 asked on 01 Feb 2023
0 answers
223 views

Binding and using this control feels quite terrible at its current state. 

My case: I want to display "HH:mm" .. as Maskk = "##:##" 

Value binding happily accepts string "10:00"

but while editing the value the propertychanged event can return "1000" which isn't compatible with the converter i've made. 

Text binding ONLY works in Mode=OneWayToSource in combination with Value binding Mode=OneWay 

Text="{Binding ToTime, Mode=OneWayToSource}"
Value="{Binding ToTime, Mode=OneWay}"

HOWEVER - when binding like this, the control doesnt clear the text when bound value changes to NULL 

eg: ToTime was "10:00" changes to NULL

The control keeps displaying "10:00"

Changing UpdateSourceTrigger from PropertyChanged to LostFocus makes the control completely faulty.. it simply stops displaying. 

ARGH

Why on earth is there two binding fields - where both are so faulty ? 

I wish there was only ONE : the Text field. 

This field should emit the masked value, whenever the UpdateSourceTrigger dictates. 

This Text field should accept "1000" as well as "10:00" but ALWAYS return "10:00" in the propertychanged event.

I'm considdering using a completely different control from another vendor instead of this mess :( 

Martin
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 27 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?