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

RadDatePicker AutoSuggest values in mid-save

2 Answers 59 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Dave2909
Top achievements
Rank 1
Dave2909 asked on 18 Dec 2015, 08:36 PM

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 Answers, 1 is accepted

Sort by
0
Dave2909
Top achievements
Rank 1
answered on 21 Dec 2015, 11:33 PM

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...

0
Martin Ivanov
Telerik team
answered on 23 Dec 2015, 03:01 PM
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
Tags
DatePicker
Asked by
Dave2909
Top achievements
Rank 1
Answers by
Dave2909
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or