Telerik RadDateTimePicker In ASP.NET Repeater and Null Values

2 posts, 0 answers
  1. Cole
    Cole avatar
    5 posts
    Member since:
    Aug 2008

    Posted 07 Oct 2008 Link to this post

    Hey All,

    I have a special events list.  The list has the event name and a date.  The list gets rendered to screen inside of an ASP.NET repeater.  My repeater uses an ArrayList of objects as it's data source. The object is "SpecialEvent" with "EventName" and "EventDate" data members. DateTime objects are garbage in VB so I use a custom Long, with the date/time being "yyyyMMddHHmmss".

    My question is what value do I need to return from this object to set a null value?  Currently I was checking

    If LongDateTime = -1 Then
    Return Nothing

    But that seems to be resolved to 1/1/1 0:00:00 AM by the datbind method in my repeater.  What is the best "Nothing" value to use with the RadDateTimePicker to stop this pesky error from happening?

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 09 Oct 2008 Link to this post

    Hello Robin,

    You may try returning System.DbNull value instead of Nothing to see whether this produces the desired result.

    Alternatively, bind the RadDateTimePicker directly to the underlying source field value using its DbSelectedDate property. Review these online resources for more details:

    Best regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top