Telerik Forums
UI for WPF Forum
1 answer
41 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
25 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
70 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
48 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
37 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
92 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
1 answer
54 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
0 answers
48 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.

Sajid
Top achievements
Rank 1
 asked on 22 Aug 2022
0 answers
40 views

I have a number of xaml files that are are using telerik masked inputs, specifically

  • telerik:RadMaskedDateTimeInput
  • telerik:RadMaskedNumericInput

and will likely be using more. These are being used to make sure the user is entering the correct input. Once the user enters the input the input data needs to run through a multiconverter. I have not been able to find a solution to bind the input data to a muliconverter. Is this possible?

I have been able to make this work in the RadGrid columns using the published work around which does not work in this context and am looking for either a way to make this work or if this is even possible.

For example, below is one of the date time inputs. How can the bound data, singleSpeedDataInt, be run through a multi binding converter?

   <telerik:RadMaskedDateTimeInput
                                                     IsEnabled="{Binding singleSpeed.UseDataInt, Mode=OneWay}"
                                                     IsClearButtonVisible="false"
                                                     Placeholder=""
                                                     Mask="HH:mm:ss"
                                                     Height="36"
                                                     Width="120"
                                                     Margin="8,0,0,0"
                                                     Value="00:01:00"
                                                     Text="{Binding singleSpeed.DataInt, Mode=TwoWay}" />
  
Paul
Top achievements
Rank 1
 asked on 14 Jul 2022
1 answer
173 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?