<tk:RadNumericUpDown Width="150" Height="50"
Value="{Binding Exposure}"
IsInteger="True"
CustomUnit="ms"/>
Hi,
I am trying to change the theme through telerik StyleManager.Theme.
Not apply :
<mynumeric:MyNumeric x:Name="TEST" Margin="-2,0,0,0"
Value="{Binding ViewModel.SerialNumber,Mode=TwoWay}"
ValueFormat="Numeric"
NumberDecimalDigits="0"
Minimum="1" Maximum="9999"
telerik:StyleManager.Theme="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.CurrentTheme),Converter={StaticResource ThemeToTelerikThemeConverter}}"
IsReadOnly="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.IsManagerAccess),Converter={StaticResource InverseBooleanConverter}}"
>
Apply :
<telerik:RadNumericUpDown x:Name="TEST" Margin="-2,0,0,0"
Value="{Binding ViewModel.SerialNumber,Mode=TwoWay}"
ValueFormat="Numeric"
NumberDecimalDigits="0"
Minimum="1" Maximum="9999"
telerik:StyleManager.Theme="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.CurrentTheme),Converter={StaticResource ThemeToTelerikThemeConverter}}"
IsReadOnly="{Binding Path=(mainwindowviewmodel:MainWindowViewModel.IsManagerAccess),Converter={StaticResource InverseBooleanConverter}}"
>
public class MyNumeric : RadNumericUpDown
{
public override string FormatDisplay()
{
if (this.Value.HasValue)
{
return this.Value.Value.ToString("0000");
}
return base.FormatDisplay();
}
public override string FormatEdit()
{
if (this.Value.HasValue)
{
return this.Value.Value.ToString("0000");
}
return base.FormatEdit();
}
}
internal class ThemeToTelerikThemeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!Enum.IsDefined(typeof(Wpf.Ui.Appearance.ThemeType), value))
throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum");
switch (value)
{
case Wpf.Ui.Appearance.ThemeType.Light:
return "Office2019";
case Wpf.Ui.Appearance.ThemeType.Dark:
return "Expression_Dark";
default:
return "Office2019";
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
I'll appreciate any help.
i am trying to custom style RadNumericUpDown control but every time i try to click right and edit control i am losing focus
tried to find the template in documentation to copy , paste and then edit, however i couldn't
can you help with this please?
Best
Dear Telerik Team,
I am using the RadNumericUpDown control for accepting the numeric value. I have made hidden the up and down tick button so it look like simple textbox. The purpose of using this control specific for Distance and Weight values so it can be in any unit of measurement. For example, meter, millimeter, feet, kg, ton etc.
For simple UOM like meter, I can simply set the CustomUnit as "m" and it works fine. But How can I represent the value of 99.11 feet to feet and inch e.g., 99 ft 1 in
So whenever user trying to edit the value, it will be in feet only and once it is edited value will be displayed in feet and inch.
How can I achieve this behavior using RadNumericUpDown control ?
Thanks & Regards,
Hiren Lad
Hello,
I'm using several RadNumericUpDown controls and when the language/region is set to English, as expected they show numbers with dots as decimal separators, which is fine. But when I set any European language/region they still show dots rather than commas. How can I fix this issue?
My code is like the snippet below:
<telerik:RadNumericUpDown Value="{Binding ScaleMin}" HorizontalAlignment="Stretch" Width="120" Margin="5"
VerticalAlignment="Center" SmallChange="0.1" ValueFormat="Numeric" IsEnabled="{Binding IsAvailable}">
<telerik:RadNumericUpDown.NumberFormatInfo>
<global:NumberFormatInfo NumberGroupSeparator="" NumberDecimalDigits="1"/>
</telerik:RadNumericUpDown.NumberFormatInfo>
<telerik:RadNumericUpDown.Resources>
<Style TargetType="{x:Type TextBox}">
<Setter Property="MaxLength" Value="8"/>
</Style>
</telerik:RadNumericUpDown.Resources>
</telerik:RadNumericUpDown>
Thanks,
G.
Hello,
I have a NumericUpDown with the following configuration:
1. NumberDecimalDigits=3
2. Binding to Double property in ViewModel
3. Validation (IDataErrorInfo) between 20-3000.
4. Small change 0.001
5. Big change 0.1
When I write 123.1234, I can see 123.123 in the UI but in the view model, you don't remove the additional digits.
I have the following problems:
1. Sometimes when using arrows up/down or page up/down, the 4 digit is removed. I expected that the snall/large change takes effect without removing any digits because the NumberDecimalDigits shall affect the UI.
2. On grouping/filtering, I want to apply the logic on the UI value instead of the binding value.
For 1234.1234 and 1234.1235 will be created two different groups.
In case that I have a double with 4 digits, but in the UI is configured to N3, I don't want to see two groups with same value in the Header Text. The user will not understand why there are two groups.
How can I configure the RadNumericUpDown to show 3 digits but if there is an error and the number has 4 digits to show 4 digits? (with this solution the user will understand why there is an error if he types 19.9996.
For this value, it will be round 20.000 and mark as error when minimim value 20 is allowed. Showing 4 digits will solve it.
How can I configure the Grouping and Filtering of the RadGridView to consider some double value as N3?
I have tried to create two RadNumericUpDown controls, first one has a minimum value and second one has a maximum value. I thought that I can bind automatically minimum value as Minimum for second control, but here is the problem.
Problem is happens when Minimum value of RadNumericUpDown control was updated, but updated Value of second control was not bound to source.
<StackPanel>
<telerik:RadNumericUpDown Value="{Binding MinValue, Mode=TwoWay}"/> //changes here are not updatind value of second control
<telerik:RadNumericUpDown Value="{Binding MaxValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Minimum="{Binding MinValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
Hello, I have an issue with the style of the ContextMenus.
I changed the style of the ContextMenu and it is working for TextBlock and TextBox but on Telerik controls like RadNumericUpDown and RadRichTextBox the context menu looks different.
Let's take for example the menu in the RadNumericUpDown (see attached picture).
I expect that the menu with Cut,Copy,Paste looks like other menus.
I tried to define in RadNumericUpDown.Resources a style for ContextMenu and RadContextMenu (change the Background property) but it doesn't work.
When I change the Foreground property of the TextBlock style inside RadNumericUpDown.Resources, I can see that the text color changed.
I hope you can guide me on this matter.
Thanks,
Alex
Hello. I am trying to add a simple Tooltip to the RadNumericUpDown control. On the style, the Tooltip content is set to RelativeSource Self, Path Value.
The problem is that my value is double and the tooltip is 3 decimal points. The RadNumericUpDown can be configured to use 1,2, or 3 decimal points but the Tooltip content is always 3 decimal points.
I tried to bind the content to the Display Text (the TextBlock inside the RadNumericUpDown) but I found that you are not raising property changed for this property.
How can I update the property to show the decimal numbers as the dependency property of the RadNumericUpDown?