RadDateTimePicker SelectedDateChanged bad data

3 posts, 0 answers
  1. TonyG
    TonyG avatar
    239 posts
    Member since:
    Feb 2006

    Posted 17 Dec 2013 Link to this post

    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. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 posts

    Posted 19 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. TonyG
    TonyG avatar
    239 posts
    Member since:
    Feb 2006

    Posted 19 Dec 2013 Link to this post

    Walking it through I did have some bad code in the event handling sequences. Thanks for your time.
Back to Top