suresh pondicherry
asked on
Avoid typing in Datepicker text
Hi All,
Advance thanks.
I am using Datepicker control in UI. Would need to restrict user only to select the date from the dropdown calender. Now when the user types in any characters in the text, it get stayed and i don't know how to clean the text. Is there any way to restrict the user not to type in anything in the text area.
Kind regards,
Pooja
Advance thanks.
I am using Datepicker control in UI. Would need to restrict user only to select the date from the dropdown calender. Now when the user types in any characters in the text, it get stayed and i don't know how to clean the text. Is there any way to restrict the user not to type in anything in the text area.
Kind regards,
Pooja
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi James,
It is working fine for first time. I mean, it is disallowing the user not to type in anything in the text first. But allow them to enter text after the date is picked from the calendar.
Kind regards,
Pooja
It is working fine for first time. I mean, it is disallowing the user not to type in anything in the text first. But allow them to enter text after the date is picked from the calendar.
Kind regards,
Pooja
You added something somewhere.
Attached is a simple form that shows the concept, and they cannot type in even after making a selection. Form1.zip
Attached is a simple form that shows the concept, and they cannot type in even after making a selection. Form1.zip
ASKER
Hi James,
Am using SL4. This is my code
Private Sub DateTimePicker_KeyPress(By Val sender As Object, ByVal e As KeyEventArgs)
If Not e.PlatformKeyCode = 9 Then e.Handled = True
End Sub
Kind regards,
Pooja
Am using SL4. This is my code
Private Sub DateTimePicker_KeyPress(By
If Not e.PlatformKeyCode = 9 Then e.Handled = True
End Sub
Kind regards,
Pooja
The code would be the same.
If the keypress cancels everything except a tabulation (that is what the 9 stands for, isn't it?) before selecting a date, it should continue to do the same after.
If you put a breakpoint in the KeyPress, is it still hit after the selection?
If so, there is no reason why the code would not still work.
If not, then something broke the link between the event and the event procedure. I am sorry, but I do not know how the procedure is linked to the event in Silverlight.
If the keypress cancels everything except a tabulation (that is what the 9 stands for, isn't it?) before selecting a date, it should continue to do the same after.
If you put a breakpoint in the KeyPress, is it still hit after the selection?
If so, there is no reason why the code would not still work.
If not, then something broke the link between the event and the event procedure. I am sorry, but I do not know how the procedure is linked to the event in Silverlight.
ASKER