Last Updated: 07 Oct 2022 12:26 by ADMIN
Release LIB 2022.3.1010 (10 Oct 2022)
Martin Ivanov
Created on: 27 Sep 2022 11:34
Category: MaskedInput
Type: Bug Report
MaskedInput: Display text doesn't match FormatString on startup of RadMaskedNumericInput when initial value in 0

The display text (the text displayed when the controls is not focused) doesn't match the FormatString on startup of RadMaskedNumericInput. This happens if the FormatString is "00" and the initial value is set to 0. In this case, the initially displayed text is "0", instead of the expected "00". When you focus the masked input control and then lost the focus, the correct display text is shown.

To workaround this, you can override the CoerceDisplayTextOverride method of RadMaskedNumericInput and replace the returned value in case it is "0".

public class CustomMaskedNumericInput : RadMaskedNumericInput
	protected override string CoerceDisplayTextOverride()
		var txt = base.CoerceDisplayTextOverride();
		if (txt == "\00")
			txt = "00";
		return txt;