Use the following code snippet and enter "8,5" in RadMaskedEditBox. Then press Tab to navigate to the next control:
RadValidationRule validationRuleNumberLess;
RadValidationRule validationRuleNumberGreater;
float numberMaximum;
float numberMinimum;
public RadForm1()
{
InitializeComponent();
CultureInfo culture = new System.Globalization.CultureInfo("de-DE");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
this.radMaskedEditBox1.Culture = culture;
this.numberMaximum = float.Parse("9,999", culture);
this.numberMinimum = 0;
// set maximum
this.validationRuleNumberLess = new RadValidationRule();
this.validationRuleNumberLess.AddControl(this.radMaskedEditBox1);
this.validationRuleNumberLess.Operator = Telerik.WinControls.Data.FilterOperator.IsLessThanOrEqualTo;
this.validationRuleNumberLess.PropertyName = "Value";
this.validationRuleNumberLess.ToolTipTitle = "Too big";
this.validationRuleNumberLess.ToolTipText = "The value must be SMALLER than " + this.numberMaximum.ToString();
this.validationRuleNumberLess.Value = (float)this.numberMaximum + 0.001D;
this.radValidationProvider1.ValidationRules.Add(this.validationRuleNumberLess);
this.radValidationProvider1.SetValidationRule(this.radMaskedEditBox1, this.validationRuleNumberLess);
// set minimum
this.validationRuleNumberGreater = new RadValidationRule();
this.validationRuleNumberGreater.PropertyName = "Value";
this.validationRuleNumberGreater.ToolTipTitle = "Too small"; // this.localToolTipTitle;
this.validationRuleNumberGreater.ToolTipText = "The value must be BIGGER than " + this.numberMinimum.ToString();
this.validationRuleNumberGreater.Operator = Telerik.WinControls.Data.FilterOperator.IsGreaterThanOrEqualTo;
this.validationRuleNumberGreater.Value = (float)this.numberMinimum;
this.validationRuleNumberGreater.AddControl(this.radMaskedEditBox1);
this.radValidationProvider1.ValidationRules.Add(this.validationRuleNumberGreater);
this.radValidationProvider1.SetValidationRule(this.radMaskedEditBox1, this.validationRuleNumberGreater);
this.radLabel1.Text = "Minimum = " + this.validationRuleNumberGreater.Value + " Maximum = " + this.validationRuleNumberLess.Value;
}
Workaround: use the ControlValidation event to control the validation flag: https://docs.telerik.com/devtools/winforms/controls/validation-provider/validation-rules#controlvalidation-event