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

RadDateTimePicker SelectedDateChanged bad data

2 Answers 64 Views
Input
This is a migrated thread and some comments may be shown as answers.
TonyG
Top achievements
Rank 1
TonyG asked on 17 Dec 2013, 07:33 AM
I think I'm being stupid on this one but I need to ask.

I have a UserControl with a RadDateTimePicker and the SelectedDateChanged event set to get handled in server codebehind. When the date or time are changed by the user, the event is fired, but neither the 'sender' nor the arguments object have all of the data.

The sender is the control but the SelectedDate on the sender is null. Sometimes the sender FocusedDate has the new value. In the SelectedDateChangedEventArgs value, the OldDate and NewDate are null.

The events being fired are in this order on PostBack:
Page_Load in the parent container, where I invoke setup methods in all user controls to set their initial values.
Page_Load for all user controls.
SelectedDateChanged
Page_LoadComplete for parent
Page_LoadComplete for each UC.
Then in Page_PreRender I get the control data and save it to SessionState so that I can refresh it the next time in.

I felt a need to go through that because controls initially weren't refreshing after postback.

I'm wondering if the sender or arguments are getting trashed prior to the SelectedDateChanged event because I load from state before that event fires. But that doesn't make sense to me.

Any ideas?
Thank you VERY much.

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 19 Dec 2013, 01:16 PM
Hi Tony,

In a simple scenario where we have a UserControl and a RadDateTimePicker in it, on the SelectedDateChanged server-side event, all the data is correct on my end.

Could you please refer to the attached sample page and see what differs in your project.

If you continue to experience difficulties with this, please modify the attached files, so they could replicate the behavior in your project and provide the markup and the code behind, so we could inspect it locally.

Looking forward to your reply.


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
TonyG
Top achievements
Rank 1
answered on 19 Dec 2013, 11:31 PM
Walking it through I did have some bad code in the event handling sequences. Thanks for your time.
Tags
Input
Asked by
TonyG
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
TonyG
Top achievements
Rank 1
Share this question
or