Unable to cast object of type 'System.DateTimeOffset' to type 'System.IConvertible'
Is it possible to use DateTimeOffset as a data field?
Thanks.
8 Answers, 1 is accepted
By default the DataStartField and the DataEndField are of type DateTime. We recommend using the TimeZoneOffset property of the RadScheduler as in the demo instead of trying to change the type of the fields to DateTimeOffset.
All the best,
Plamen Zdravkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Or are you saying that I can use DateTimeOffset for DataStartField and DataEndField as long as I also set the TimeZoneOffset property?
In that case you can use a converter from DateTimeOffset to DateTime. Please take a look at this MSDN article for how to convert between DateTime and DateTimeOffset.
Hope this helps.
Greetings,
Plamen Zdravkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
I'm trying to set the DataStartField and DataEndField using this methodology:
Dim s As New RadScheduler()
s.ID = "MyScheduler"
s.DataSource = [MyListOfCustomObjects]
s.DataKeyField = "RepetitionID"
s.DataSubjectField = "ShortName"
s.DataStartField = "BeginDateTime"
s.DataEndField = "EndDateTime"
s.SelectedDate = Date.Today
s.SelectedView = SchedulerViewType.MonthView
s.DataBind()
Unfortunately this will not work (and throw the exception I listed in my first post), as "BeginDateTime" and "EndDateTime" are both DateTimeOffset data types from SQL Server. I need to know if the RadScheduler can somehow support DateTimeOffset values.
We inspected the issue and it seems that RadScheduler accepts only DateTime type for StartTime and EndTime fields and do not support DateTimeOffset for these properties.
All the best,
Plamen Zdravkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Thank you for the reply. Can you please create a feature request to allow DataStartField and DataEndField to accept DateTimeOffset values?
Thanks again.
Thank you for the suggestion. We will consider it.
All the best,
Plamen Zdravkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.