How is it possible to throw an exception with SelectedDate, if its new value is Nothing?

5 posts, 0 answers
  1. Nicolas
    Nicolas avatar
    3 posts
    Member since:
    Sep 2015

    Posted 23 Sep 2015 Link to this post

    Hello,

    In the DbSelectedDate property documentation, it is stated that it behaves exactly like the SelectedDate property. The only difference is that it will not throw an exception if the new value is null or DBNull.

    http://www.telerik.com/help/sitefinity/developer-manual/radcalendar.net2-telerik.webcontrols.raddatepicker-dbselecteddate.html

    It is also stated that null in C# is Nothing in VB. I use VB and cannot see how SelectedDate can throw an exception if its new value is Nothing. I tried this:
    ctlRadDateTimePicker.SelectedDate = Nothing

    How is it possible to throw an exception? Why there is this remark?

    Best regards,
    Nicolas

  2. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 28 Sep 2015 Link to this post

    Hi Nicolas,

    You can check the pickers in the following live sample:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

    If the SelectedDate property is used instead, a server-side exception may be thrown when opening the insert form for example. You can also test that with a RadNumericTextBox with Value and DBValue.

    Regards,
    Eyup
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nicolas
    Nicolas avatar
    3 posts
    Member since:
    Sep 2015

    Posted 29 Sep 2015 in reply to Eyup Link to this post

    Hello Eyup,

    Thank you for answering.

    You shown me an example with databound control.

    However, is it possible to raise an exception only by assigning value to RadDateTimePicker SelectedDate property?

    We have a problem here and nobody is able to reproduce it. It seems to occur while assigning a date. Our control is not bound to any dataset. We assign the value in the code. So I thought that it might be caused by SelectedDate. When I saw the DBSelectedDate documentation stating that an exception might be raised, I believed that it might be related.

    Text_property_cannot_be_set._String_was_not_recognized_as_a_valid_DateTime. Text_property_cannot_be_set._String_was_not_recognized_as_a_valid_DateTime. ___at_Telerik.Web.UI.RadDateInput.RangeTextProperty(String_value) ___at_Telerik.Web.UI.RadDateInput.set_Text(String_value) ___at_Telerik.Web.UI.DatePickingInput.LoadPostData(String_postDataKey,_NameValueCollection_postCollection) ___at_System.Web.UI.Page.ProcessPostData(NameValueCollection_postData,_Boolean_fBeforeLoad) ___at_System.Web.UI.Page.ProcessRequestMain(Boolean_includeStagesBeforeAsyncPoint,_Boolean_includeStagesAfterAsyncPoint)

    Best regards,

    Nicolas
  5. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 02 Oct 2015 Link to this post

    Hello Nicolas,

    Could you prepare a new web site sample to isolate the issue and open a formal support ticket to send it to us? Thus, we will be able to further analyze and debug the project and try to determine the cause of the problem.

    Regards,
    Eyup
    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
  6. Nicolas
    Nicolas avatar
    3 posts
    Member since:
    Sep 2015

    Posted 02 Oct 2015 in reply to Eyup Link to this post

    Hello Eyup,

    Thank you for answering.

    OK, I will try to reproduce the issue with a sample. I will open a support ticket if I succeed to reproduce it.

    Best regards,

    Nicolas
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017