Reading the telerik help on this control is not very helpful at all.
I just want a maskedinput control that is the following [0-9]\+[0-5][0-9]
M+SS, so it would display --> _+__
Minutes, can be 0-9
Seconds, 00 to 59
I'd like to be able to use a masked input control to allow the user to enter a hexadecimal number representing a color value (ARGB) e.g. #FF445566 or 0x445566. Is there some way I can use one of the mask controls to achieve this?
Thanks
Pete
How can I prevent the user from entering or pasting text that contains newlines in a RadMaskedTextInput. The user should also not be able to enter a newline using Ctrl+Return or Shift+Return or Alt+Return.
Setting the `AcceptsReturn` property to `false` has no effect at all. And its documentation states
> "Gets or sets a value indicating whether newline is accepted when the mask supports multiline."
Unfortunately the docs fail to mention how to set set a mask that prevents multiline.
Hello,
I have a RadMaskedInput to gather information on a form. I have a button that saves the information on the form, then clears the form. When I click the RadMaskedInput a second time to enter a new value, it uses the a cache of the previously entered value, which I have to delete before I can continue typing or some parts of the previous text will remain with my new text. Is there a way to disable this caching so that that RadMaskedInput never shows previous data that was entered?
Thanks.
Hello I encountered a bug or odd behaviour in the RadNumericUpDown control. I use caliburn micro as a MVVM framework to bind a simple property to the Value of the control. On KeyDown I check the value and if a condition fails, I reset the value to the last valid state.
The Problem is that the Value is not updated despite the PropertyChanged event firing correctly. The value is updated after the focus is lost.
class
ShellViewModel : Screen
{
/// <summary>
/// Value before change
/// </summary>
protected
double
ValueBeforeChange;
private
double
value;
/// <summary>
/// Gets or sets the value
/// </summary>
public
new
double
Value
{
get
=> value;
set
{
if
(!(Math.Abs(value -
this
.value) >
double
.Epsilon))
{
return
;
}
Console.WriteLine($
"Value changed to {value}"
);
this
.value = value;
NotifyOfPropertyChange(() => Value);
}
}
public
ShellViewModel()
{
Value = 10;
ValueBeforeChange = Value;
}
public
new
void
KeyDown(
object
sender, KeyEventArgs e)
{
if
(e.Key == Key.Return || e.Key == Key.Enter)
{
if
(Value > 20)
{
Value = ValueBeforeChange;
}
else
{
ValueBeforeChange = Value;
}
}
}
}
<
UserControl
x:Class
=
"RadUpDownBug.Views.ShellView"
xmlns:cal
=
"http://www.caliburnproject.org"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"450"
d:DesignWidth
=
"800"
>
<
StackPanel
>
<
telerik:RadNumericUpDown
x:Name
=
"Numeric"
FontSize
=
"24"
ValueFormat
=
"Numeric"
NumberDecimalDigits
=
"2"
Value
=
"{Binding Value, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ShowButtons
=
"False"
UpdateValueEvent
=
"PropertyChanged"
cal:Message.Attach
=
"[Event KeyDown] = [Action KeyDown($this,$eventArgs)];"
Margin
=
"0"
/>
<
TextBox
></
TextBox
>
</
StackPanel
>
</
UserControl
>
So entering a value above 20 and pressing enter should result in the control displaying the last value (10 at the beginning) But it does not. If you click on the TextBox the control is correctly updated.
Why does this happen and how do I fix this?
I'm trying to only allow users to type in 6 digits integer with prefix "CA", and now I can only type in one leading zero, not multiple zeros.
Here is my code, and ProjectNumber is a nullable double.
<telerik:RadMaskedNumericInput
Grid.Column="0"
Margin="25, 0, 0, 10"
Width="100"
Mask="CA#####"
Placeholder=""
AutoFillZeros="False"
AutoFillNumberGroupSeparators ="False"
IsClearButtonVisible="False"
AllowInvalidValues="True"
Validation.ErrorTemplate="{x:Null}"
maskedInput:MaskedInputExtensions.Minimum="0"
HorizontalContentAlignment="Left"
HorizontalAlignment="Left"
Value="{Binding Path=(viewModel:IProjectFolderViewModel.ProjectNumber), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
Also, the prefix 'CA' only appears after users click on the input box or type in something. is there anyway that we could show the prefix all the time.
I am trying to validate a Textbox that will hold an IP Address. I have a working example that works as expected
<telerik:RadMaskedTextInput ValidationRegex="{x:Static maskedInput:ValidationHelper.IP}" x:Name="hueIpAddress" Height="23" Margin="203,39,0,0" VerticalAlignment="Top" Width="120" HorizontalAlignment="Left"
EmptyContent="Enter IP Address"
InputBehavior="Insert"
Mask="{Binding Path=Text, ElementName=Mask, Mode=TwoWay}"
IsClearButtonVisible="False"
SelectionOnFocus="CaretToEnd"
TextMode="PlainText"
UpdateValueEvent="ProperyChanged" />
But no matter what I do, I cannot get an event to fire when the value is updated. I have tried ValueChanged and ValueChanging, but none fire as expected, and I am not interested in playing the PreviewTextInput/KeyDown game which is unreliable. I want to be able to update a label on my page with the current value of the text box, and doing it via the handle method as I will need to do other stuff as well.
Can someone please inform me how you can set this type of control either in xaml or code behind to be in TypeOver mode rather than Insert mode?
I have searched the web and can't seem to find anything...
Hi,
I have this RadMaskedTextInput:
<
telerik:RadMaskedTextInput
IsClearButtonVisible
=
"True"
TextMode
=
"PlainText"
Placeholder
=
" "
Mask="a4/>a3" Margin="2,0,2,0" AcceptsReturn="False" HorizontalAlignment="Stretch" Value="{Binding FilterPasse}" ValueMode="IncludeLiterals" SelectionOnFocus="CaretToBeginning"/>
Following implicit style is used
<
Style
x:Key
=
"DefaultTelerikMaskedTextInputStyle"
TargetType
=
"telerik:RadMaskedTextInput"
BasedOn
=
"{StaticResource RadMaskedTextInputStyle}"
>
<
Setter
Property
=
"MinHeight"
Value
=
"{StaticResource DefaultMinimumHeight}"
/>
<
Setter
Property
=
"FontFamily"
Value
=
"{StaticResource DefaultFont}"
/>
<
Setter
Property
=
"FontSize"
Value
=
"{StaticResource DefaultFontSize}"
/>
<
Setter
Property
=
"FontWeight"
Value
=
"{StaticResource DefaultFontWeight}"
/>
<
Setter
Property
=
"SectionsNavigationMode"
Value
=
"None"
/>
<!--https://www.telerik.com/forums/how-do-i-make-it-possible-for-a-user-to-tab-immediately-out-of-the-masked-text-input-->
<
Setter
Property
=
"Validation.ErrorTemplate"
Value
=
"{StaticResource ErrorTemplate}"
/>
<
Style.Triggers
>
<
Trigger
Property
=
"IsEnabled"
Value
=
"True"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource DefaultTextBoxBackgroundColor}"
/>
</
Trigger
>
<
Trigger
Property
=
"IsEnabled"
Value
=
"False"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource DefaultTextBoxDisabledBackgroundColor}"
/>
</
Trigger
>
<
Trigger
Property
=
"IsFocused"
Value
=
"True"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource DefaultTextBoxIsFocusedBackgroundColor}"
/>
</
Trigger
>
<
Trigger
Property
=
"IsReadOnly"
Value
=
"True"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource DefaultTextBoxIsReadOnlyBackgroundColor}"
/>
</
Trigger
>
</
Style.Triggers
>
</
Style
>
<
Style
TargetType
=
"{x:Type telerik:RadMaskedTextInput}"
BasedOn
=
"{StaticResource DefaultTelerikMaskedTextInputStyle}"
/>
When running the application the slash (in the mask) is shown twice (see attached pictures). Any ideas why ?
Regards,
Hans