Hi,
I am using two DateTime Picker (set to BOTH Date&Time) and when I am trying to retrieve data from database, it is throwing an exception. From event viewer, I got this :
Stack trace: at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
at System.DateTime..ctor(Int32 year, Int32 month, Int32 day)
at Telerik.Web.UI.Calendar.Utils.Utility.ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, String inputString) in c:\Users\Administrator\Desktop\UI for ASP.NET AJAX\Telerik.Web.UI_2013_2_717_Source\RadControlsAjaxSource\Telerik.Web.UI\Calendar\Utility\Utility.cs:line 274
at Telerik.Web.UI.RadCalendar.LoadPostData(String postDataKey, NameValueCollection postCollection) in c:\Users\Administrator\Desktop\UI for ASP.NET AJAX\Telerik.Web.UI_2013_2_717_Source\RadControlsAjaxSource\Telerik.Web.UI\Calendar\RadCalendar.cs:line 5041
at Telerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) in c:\Users\Administrator\Desktop\UI for ASP.NET AJAX\Telerik.Web.UI_2013_2_717_Source\RadControlsAjaxSource\Telerik.Web.UI\Common\RadWebControl.cs:line 742
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
- We are UI for ASP.Net AJAX (Telerik version 2013.2.717.35).
- It is working fine for few TimeZone like Pacific Time but giving error in like UTC +5.30 etc.
- The error is only occurring when we are setting it to both (Date & Time ) while it is working fine in only Date Format.
I tried Debugging into Telerik Source, and I found that the exception is coming in this funtion:
/// <summary>
/// Converts an input 2D JavaScript array like [[5,10,2005],[6,10,2005],[7,10,2005]] into a DateTimeCollection.
/// </summary>
/// <param name="dateTimeCollection">The DateTimeCollection that will be filled.</param>
/// <param name="inputString">The input string.</param>
internal static void ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, string inputString)
{
int i, BracketCount = 0;
if (String.IsNullOrEmpty(inputString)) return;
for (i = 0; i < inputString.Length; i++)
{
if (inputString[i] == '[')
BracketCount++;
else if (inputString[i] == ']')
BracketCount--;
}
if (BracketCount != 0)
{
throw new FormatException(Constants.Exception.FormatInputJavaScriptDateException);
}
// Remove the "[" and the "]"
inputString = inputString.Replace("[", String.Empty).Replace("]", String.Empty);
string[] ArrDates = inputString.Split(",".ToCharArray());
for (i = 0; i < ArrDates.Length / 3; i++)
{
DateTime CurrentDateTime = new DateTime(Int32.Parse(ArrDates[i * 3]), Int32.Parse(ArrDates[i * 3 + 1]), Int32.Parse(ArrDates[i * 3 + 2]));
dateTimeCollection.Add(new RadDate(CurrentDateTime));
}
}
Please suggest some way to get rid from this problem.
Thanks