Unplanned
Last Updated: 26 May 2023 13:52 by Martin Ivanov
Martin Ivanov
Created on: 26 May 2023 13:52
Category: MaskedInput
Type: Bug Report
0
MaskedInput: Wrong text value displayed when the minimum of MaskedCurrencyInput is set to 0 and negative value is pasted

The decimal.MinValue is displayed when e negative value is pasted in RadMaskedCurrencyInput when the maskedInput:MaskedInputExtensions.Minimum attached property is set to 0, and the current Value is null.

To work this around, you can override the HandlePaste method of the masked input control.

public class CustomMaskedCurrencyInput : RadMaskedCurrencyInput
{
	protected override void HandlePaste()
	{
		object clipBoardValue = Clipboard.GetText();
		if (clipboardValue can be parsed to a number and it is a negative number)
		{
			// don't call the base method
		}
		else 
		{
			base.HandlePaste();
		}
	}
}

0 comments