RadDatePicker and DataForm doesn't work together

10 posts, 0 answers
  1. uku
    uku avatar
    57 posts
    Member since:
    Mar 2009

    Posted 11 Nov 2009 Link to this post

    Hello,

    I'm using RIA services and have a dataform which includes a RadDatePicker.
    When I select another date from the datepicker the dataform doesn't notice that and the OK button remains disabled.
    So when I want to have an enabled OK button to store the new date I always have to make a dummy modification in another control e.g. in a text box.

    How can I handle it to force the dataform to take notice of the date modification.

    The definition of the RadDatePicker in the dataform is shown below

    <dataform:DataField Grid.Row="0" Grid.Column="1" Label="Creation" LabelPosition="Top"  Width="120"  HorizontalAlignment="Left">  
         <telInput:RadDatePicker SelectedDate="{Binding Path=CreationDate, Mode=TwoWay, UpdateSourceTrigger=Explicit}"/>  
    </dataform:DataField> 
     

    Thanks for your help

    Uwe
    T
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 16 Nov 2009 Link to this post

    Hello uku,

    I am sorry for the problem you are facing with our RadDatePicker control. Sharing some more code with us will be of great help for us.

    Kind regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Rameshkumar Gundalapudi Vijayakumar
    Rameshkumar Gundalapudi Vijayakumar avatar
    6 posts
    Member since:
    Feb 2010

    Posted 23 Apr 2010 Link to this post

    Hi,

    Actually i have a similar requirement as with uku.

    I have a RadDatePicker where i can type the date and also i select a date.

    I have a save button which should become enabled the moment i change the date in date picker.

    Problem is only when i change the date using datepicker, the save is getting triggered. If i type in a date, only when the datepicker is lost focus, save is getting enabled. I want the save to be enabled the moment i type in some text using keyboard in the datepicker text box.

    I am using the following code and it is not working

    SelectedDate

     

     

    ="{Binding Path=SampleDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"

     

  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 28 Apr 2010 Link to this post

    Hi Rameshkumar Gundalapudi Vijayakumar,

    The problem is that the typed value in the TextBox of the control is parsed to a valid date after loosing its focus. That means that the property will be updated after lost focus of the control. In your case you can use the KayUp event of the control to change the enabled condition of the button. Let us know if you need any further help.

    Kind regards,
    Kaloyan
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Rameshkumar Gundalapudi Vijayakumar
    Rameshkumar Gundalapudi Vijayakumar avatar
    6 posts
    Member since:
    Feb 2010

    Posted 28 Apr 2010 Link to this post

    Hi Kaloyan,

    Is there any way to do this in XAML itself, as i am using MVVM architectur. Please refer the below thread. WPF datepicker works as expected.

    http://www.telerik.com/community/forums/wpf/datepicker/raddatepicker-and-updatesourcetrigger.aspx

    Thanks,
    Ramesh.
  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 29 Apr 2010 Link to this post

    Hi Rameshkumar Gundalapudi Vijayakumar,

    Actually adding such a text property is probably the most correct way that will be applied in MVVM scenarios. We will consider adding it in some of the next control version. Please find the attached demo as a workaround of the current limitation.

    Best wishes,
    Kaloyan
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Kjetil
    Kjetil avatar
    13 posts
    Member since:
    Oct 2010

    Posted 20 Jan 2014 Link to this post

    Hi,

    This solution doesn't really help for us. We have designed the app to have 'auto save', so that when the user navigates to another screen the changes on the current screen will be automatically saved. When the user inputs a date in the RadDateTimePicker using text and not the gui date picker, these changes will not be picked up by the view model when the user navigates away. 

    Is there any updates on the RadDateTimePicker that can force the date parsing when the properyt changes?
  9. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 23 Jan 2014 Link to this post

    Hi Kjetil,

    We tested the described scenario with the latest release version of the controls (Q3 2013 SP1) and it worked as expected. I have bound the SelectedValue property of the DatePicker to a property in the ViewModel and when you type a date and change the view the value of the property in the ViewModel changes. I'm attaching my test project so you can check it

    Hope this helps. If you have any further concerns or questions let us know.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  10. Kjetil
    Kjetil avatar
    13 posts
    Member since:
    Oct 2010

    Posted 23 Jan 2014 Link to this post

    The attached project is a Silverlight project. Do you have the same example as WPF?
  11. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 24 Jan 2014 Link to this post

    Hi Kjetil,

    You can use the same code for a WPF without a problem.

    Please try that and let us if you have any further concerns or questions.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner