Validate the DateTimePicker Control in silverlight page
To Block,entering alphabets and other characters in TextBlock Of the DateTime Control in Silverlight Page
private void txtToDate_KeyDown(object sender, KeyEventArgs e)
{
if ((e.Key < Key.D0 || e.Key > Key.D9) && (e.Key < Key.NumPad0 || e.Key > Key.NumPad9) && (e.PlatformKeyCode != 191))
{
e.Handled = true;
}
}
this code only allow to enter nubers and backslashes.
For ex:01/01/2010
