RadDatePicker Input Events
I was looking for some kind of event that is fired on a RadDatePicker (a telerik control) when text is typed into the control.
It must be fired on every key stroke.
I tried to grab the keyup even开发者_如何学Ct, which works fine, but ... if I have typed into the field something like 1/1/201 (which is an incomplete date) the SelectedValueProperty is not set to the incomplete date that I have typed.
So why do I want that? I should explain. When I find that something in the field is changed I want to update the field that the date is bound to (like using UpdateSourceTrigger.PropertyChanged in WPF).
What is in that field (and other fields) will determine whether another button on the page is active or not.
I am guessing that the solution would be the same as a normal DatePicker because what it comes down to is that a RadDatePicker has an internal TextBlock where the date is typed / edited.
Thanks,
Peter.
I found an answer for this question that works quite nicely.
On the RadDatePicker control there is a property called CurrentDateTimeText. I am binding to that, not to get the date (I am also binding to the SelectedValue to get the date) but just so that I can tell if the user has entered anything into the field or not.
You can easily do it with jQuery:
$('#yourTelerikControl').keypress(function() {
alert('Handler for .keypress() called.');
});
精彩评论