This is a migrated thread and some comments may be shown as answers.

Date Picker Text Input Events

2 Answers 107 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 17 Nov 2010, 11:08 PM
Hi There,

I noticed in silverlight that the UpdateSourceTrigger in a binding cannot be set to PropertyChanged like it can in WPF.

I have a couple of DatePicker controls, and the binding must be updated as soon as someone enters some text into the control, not when the control looses the focus.

Any ideas?

What would work OK is if I could subscribe to some event that would fire as soon as I enter something into the Date Picker controls. I have tried the various events available and couldn't find anything that worked.

There are various solutions such as this, but they only seem to apply to TextBoxes,

http://www.codeproject.com/KB/silverlight/SLUpdateSourceTrigger.aspx

My question seems to be related to this,

http://www.telerik.com/community/forums/wpf/datepicker/update-datacontext-from-datepicker-whitout-leaving-input-field.aspx

Thanks, Peter.

2 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 18 Nov 2010, 03:50 AM
Just to let you know what I have found, which seems to work.

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.

If the setter on my view model property gets called (for the CurrentDateTimeText) I store that value, and call notifypropertychanged on some other properties, and hey presto it works.

What I am doing is making a button enabled or disabled based on whether anything is entered into that date field.

Unless you see any issues I will go for this solution.

Thanks,

Peter.
0
Konstantina
Telerik team
answered on 23 Nov 2010, 08:25 AM
Hello Peter,

This seems as a suitable workaround for your case. We are glad that you have found a solution yourself.

Please let us know if you have any other questions about our controls.

Kind regards,
Konstantina
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
DatePicker
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or