RadDatePicker AutoSuggest values in mid-save

3 posts, 0 answers
  1. Dave2909
    Dave2909 avatar
    2 posts
    Member since:
    May 2007

    Posted 18 Dec 2015 Link to this post

    Here's a simple example of a problem we have throughout a rather large app:

    We've got a view with a RadRibbonButton for 'Save' and a RadDatePicker.  When the user clicks Save, the view remains open after saving.  The problem we have is that users are clicking on Save while in the process of editing the date in the TextBox of the RadDatePicker.  The result of this is that the 'old' date value is the one that's actually saved in the button click event, THEN the DatePicker updates to show the 'new' date value.  (In our real app, this gets very confusing with various validation, etc.)

     So, we want to make sure that what is saved matches what is displayed after the save.  Do you have any suggestions for how to either 1) Force the RadDatePicker to process all input before saving in the ButtonClick, or 2) Prevent / abort any pending inputs to the DatePicker in ButtonClick.

    (We'd prefer to find a solution we can package in our custom class derived from DatePicker, which is used in many places throughout the app, if possible.) 

     

    Thanks,

     Dave

     

     

  2. Dave2909
    Dave2909 avatar
    2 posts
    Member since:
    May 2007

    Posted 21 Dec 2015 in reply to Dave2909 Link to this post

    It looks like this was a symptom of the fact that the RadRibbonView is specifically designed NOT to change the focus of controls on the page.  The strange thing is, that it doesn't prevent the focus events, it appears to just delay them.  (So, for example, after saving, a date may display something different than what was actually saved.)

     

    In any case, setting RadRibbonButton.IsTabStop="True" appears to have the events firing in the desired order - we just need to sort out some changes to the UI to account for the buttons being tab stops...

  3. DevCraft banner
  4. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 23 Dec 2015 Link to this post

    Hello David,

    Indeed, the ribbonview control doesn't get the focus when you interact with it. As for the focus events, I am not sure which events you mean. Can you tell me what events are fired with delay and in what scenario?

    About your requirement, you can prevent saving (or save) the date in the event handler of the RadRibbonButton's Click event. You can take a look at the attached project to see a possible implementation for your scenario. I hope this is useful.

    Regards,
    Martin
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top