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

[Solved] Daily Recurrence Problem

5 Answers 170 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Afsar Ethem Emekli
Top achievements
Rank 1
Afsar Ethem Emekli asked on 22 Feb 2010, 01:32 PM

Hello,

It's installed "RadControls for ASP.NET AJAX Q2 2009 SP1" and "Microsoft ASP.NET 2.0 AJAX Extensions v1.0.61025" on my computer. When I run Live Examples -> Scheduler -> Populating With Data -> XML Provider, double click an appointment, set a "Daily Recurrence Rule" for it and press Save, I got an JavaScript alert telling that "Object reference not set to an instance of an object.". There is no problem with other type of recurrence rules (Hourly, Weekly, Monthly and Yearly). I also tried other examples (e.g. Database Provider), and I had the same problem with them also saving with a daily recurrence rule.

Could anyone please help me solving this problem?

Thank you,

Afsar.

5 Answers, 1 is accepted

Sort by
0
Afsar Ethem Emekli
Top achievements
Rank 1
answered on 22 Feb 2010, 01:44 PM

The following is the detailed error information when I debug the page.

Server Error in '/Live Demos' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RecurrenceRule.TryParse(String input, RecurrenceRule& rrule) +1226
   Telerik.Web.UI.AdvancedEditTemplate.ExtractValues(Control container) +162
   Telerik.Web.UI.RadScheduler.UpdateAppointmentInline(Boolean removeExceptions) +137
   Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +491
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

0
Afsar Ethem Emekli
Top achievements
Rank 1
answered on 22 Feb 2010, 03:43 PM

I think I found the problem. My "regional settings" is set to Turkish. And I think rad library converts recurrence types from lower case to upper case. When I select daily recurrence, it converts it from "daily" to "DAİLY" (where in English regional settings, it is supposed to be "DAILY"). Then I think this causes the problem.

Does anyone have any suggestions to solve this problem?

0
T. Tsonev
Telerik team
answered on 25 Feb 2010, 10:11 AM
Hi Afsar,

Thank you for reporting the issue and finding the actual cause. We're a bit ashamed that we've fallen for the classic Turkish I problem. We'll fix this right away and the fix will be available in the next internal build.

As a token of our gratitude for your involvement, your Telerik points have been updated.

Regards,
Tsvetomir Tsonev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Afsar Ethem Emekli
Top achievements
Rank 1
answered on 01 Mar 2010, 03:28 PM

Hello Tsvetomir,

Thank you for your interest and the points you gave to me. But I had to continue my project and at last, I found my own solution. Those who have the same issue can refer to this.

A revision of Scheduler's FirstLook example : http://www.zumodrive.com/share/3UZeYzA4OT

A sample screen-shot is attached.

The followings are the steps to prevent this problem.

1. The page must have English culture.

At the top of the page the culture can be set as : <%@ Page Culture="en-US" UICulture="tr-TR"

Note that the UICulture property can be set to Turkish culture. But the Culture property has to be set to English culture.

2. At the Page_Init event the culture property of calenders, schedulers, etc. must be set to Turkish culture.

For example,

RadCalendar1.CultureInfo = getTRCulture();
RadCalendar2.CultureInfo = getTRCulture();
RadScheduler1.Culture = getTRCulture();

Where getTRCulture() is

private CultureInfo getTRCulture()
{
return CultureInfo.GetCultureInfo("tr-TR");
}

3. While coding, programmer can prefer to code according to Turkish culture instead of English culture. He might prefer to write DateTime.Parse("31.12.2009") instead of DateTime.Parse("12/31/2009"). To do that the culture setting must be changed to Turkish at the beginning of the code and it must be changed to English again at the end of the code.

For example,

try
{
setThreadCultreTR();
DateTime dtSelectedDate = DateTime.Parse("31.12.2009"); //instead of "12/31/2009"
RadScheduler1.SelectedDate = dtSelectedDate;
RadCalendar1.SelectedDate = dtSelectedDate;
}
catch (Exception ex)
{

}
finally
{
setThreadCultreEN();
}

Where setThreadCultreTR() and setThreadCultreEN() are

private void setThreadCultreTR()
{
Thread.CurrentThread.CurrentCulture = getTRCulture();
}
private void setThreadCultreEN()
{
Thread.CurrentThread.CurrentCulture = getENCulture();
}

And where getENCulture() is

private CultureInfo getENCulture()
{
return CultureInfo.GetCultureInfo("en-US");
}

0
Dimitar Milushev
Telerik team
answered on 02 Mar 2010, 01:14 PM
Hi Afsar,

Thank you for sharing the workaround you have found. I'm glad you'll be able to continue working while we fix the problem.

Regards,
Dimitar Milushev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Afsar Ethem Emekli
Top achievements
Rank 1
Answers by
Afsar Ethem Emekli
Top achievements
Rank 1
T. Tsonev
Telerik team
Dimitar Milushev
Telerik team
Share this question
or