Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
<
telerik:RadMaskedTextInput
Grid.Row
=
"7"
Grid.Column
"1"
Value
"{Binding Path=Shareholder.TaxIdSecondary, Mode=TwoWay, Converter={StaticResource RadMaskedTextInputStringToNullConverter}, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
IsEnabled
"{Binding IsEditMode}"
Margin
"5"
EmptyContent
"Secondary Tax ID"
Mask
"###-##-####"
TextMode
"MaskedText"
SelectionOnFocus
"SelectAll"
InputBehavior
"Replace"
></
>
// This converter is to allow for setting the value to null when the user clicks the clear button on the RadMaskedTextInput
public
class
RadMaskedTextInputStringToNullConverter : IValueConverter
{
object
Convert(
value, Type targetType,
parameter, System.Globalization.CultureInfo culture)
return
value;
}
ConvertBack(
// if value is a string and it's empty, return null
if
(value.GetType() ==
typeof
(
string
))
var valueAsString = value
as
;
.IsNullOrEmpty(valueAsString))
null
// otherwise just return the value