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

Telerik RadDateTimePicker In ASP.NET Repeater and Null Values

1 Answer 126 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Cole
Top achievements
Rank 1
Cole asked on 07 Oct 2008, 09:56 PM
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?

Thanks,
Rob

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 09 Oct 2008, 02:34 PM
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:

http://demos.telerik.com/ASPNET/Prometheus/Calendar/Examples/DatePicker/DataBinding/DefaultCS.aspx
http://www.telerik.com/help/aspnet-ajax/calendar_pickerdatabinding.html

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Cole
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or