This leads to a wrong value displayed in the masked input. The mask is always coerced to "hh:mm:ss.ff". An additional, 'f' is added to the mask. Probably, this will happen also if you have a single letter on another position in the mask.
To work this around you can create a custom masked input control and override its CoerceTextOverride() method. There you can implement some logic that replaces the wrong milliseconds text. Here is an example in code:
public class CustomMaskedDateTimeInput : RadMaskedDateTimeInput
{
protected override string CoerceTextOverride(ref int selectionStart)
{
var text = base.CoerceTextOverride(ref selectionStart);
if (this.Value.HasValue &&
this.Mask != null &&
this.Mask.Contains("hh:mm:ss.f"))
{
int millisecondsAllowedLength = GetAllowedMillisecondsLength(this.Mask); // example: .ff means that there are 2 allowed millisecond chars
int millisecondsMaxLength = 3; // max = 999
var milliseconds = this.Value.Value.Millisecond.ToString(); // the original milliseconds give from the value
var zeroesCount = millisecondsMaxLength - milliseconds.Length; // how many zeroes should be append before the millseconds string value
milliseconds = new string('0', zeroesCount) + milliseconds; // append the zeroes
// apply the milliseconds restriction given by the Mask (.ff - two symbols)
if (milliseconds.Length > millisecondsAllowedLength)
{
int charsToRemoveCount = milliseconds.Length - millisecondsAllowedLength;
for (int i = 0; i < charsToRemoveCount; i++)
{
milliseconds = milliseconds.Remove(milliseconds.Length - 1, 1);
}
}
// replace the default parsed millseconds part of the string with the custom milliseconds
var millisecondsIndex = text.LastIndexOf(".") + 1;
text = text.Remove(millisecondsIndex, millisecondsMaxLength - millisecondsAllowedLength);
text = text.Insert(millisecondsIndex, milliseconds);
}
return text;
}
private int GetAllowedMillisecondsLength(string mask)
{
int length = 0;
var millisecondsIndex = mask.LastIndexOf(".") + 1;
if (millisecondsIndex != -1)
{
length = mask.Length - millisecondsIndex;
}
return length;
}
}