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

Schedular recurrence

30 Answers 357 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Iry Lee
Top achievements
Rank 2
Iry Lee asked on 22 Feb 2010, 07:02 AM
i noticed schedular got recurrence with a few readonly property.
i couldn't find how i can store / set data.
normally how we can save the data?
and how about the all day check box?
i using asp.net with SQL database.

30 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 22 Feb 2010, 10:03 PM
I believe this help article should be of use:


It tells you the database structure needed to use recurrence.
0
Iry Lee
Top achievements
Rank 2
answered on 23 Feb 2010, 01:15 AM
my question is actually how to get value from scheduluer to insert into db?
and how to set the value after i retrieve from database?
0
Peter
Telerik team
answered on 23 Feb 2010, 03:19 PM
Hi Iry,

You can handle AppointmentUpdate/Delete/Insert events to access appointment values and manipulate the database with them. Here is a demo for reference:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/bindtolist/defaultcs.aspx


Regards,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 24 Feb 2010, 06:26 AM
thanks for your reply.
I'm using AdvanceForm which the coding for get and set data is at AdvanceForm.ascx.vb file and it is different from the demo.

Just like subject and description, recurrence got a property function at AdvanceForm.ascx.vb:
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _ 
    Public Property RecurrenceRuleText() As String 
        Get 
            If Owner.RecurrenceSupport Then 
                Dim rrule As RecurrenceRuleRecurrenceRule = RecurrenceRule.FromPatternAndRange(Pattern, Range) 
 
                If rrule = Nothing Then 
                    Return String.Empty 
                End If 
 
                Dim originalRule As RecurrenceRuleRecurrenceRule = RecurrenceRule.Empty 
                If RecurrenceRule.TryParse(OriginalRecurrenceRule.Value, originalRule) Then 
                    rrule.Exceptions = originalRule.Exceptions 
                End If 
 
                Return rrule.ToString() 
            End If 
 
            Return String.Empty 
        End Get 
 
        Set(ByVal value As String) 
            OriginalRecurrenceRule.Value = value 
        End Set 
    End Property 

then at the schedular page's aspx file, it bind the data:
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'

i assume recurrece's get/set data is the same with subject and description, so when insert appointment, i code as below to insert the data to database:
ALIN.Add(e.Appointment.RecurrenceRule)

but the RecurrenceRule column (nvarchar(1024)) is empty even i insert an appointment with recurrence. (is empty string, not NULL)

so, i wonder is that i get the data in a wrong way.
but i couldn't find any answer at demo and the forum.


0
Iry Lee
Top achievements
Rank 2
answered on 01 Mar 2010, 03:28 AM
can someone help me?
i've been waiting for 5days
0
Peter
Telerik team
answered on 01 Mar 2010, 02:58 PM
Hi Iry,

Yes, your assumption is correct - you can access RecurrenceRule just like any other property such as Subject, Start, End, etc...

Which event do you handle? Is it AppointmentInsert? Can you use a debugger to check what the value for RecurrenceRule is in the event handler?


All the best,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 02 Mar 2010, 04:00 AM
thanks for your reply again Petter.
yes, it is in the insertappointment event handler.
here is the screen capture of the data i key in(insertevent.jpg), and the value that it gets(empty.jpg).


0
Iry Lee
Top achievements
Rank 2
answered on 05 Mar 2010, 07:25 AM
still awaiting for the answer
0
Peter
Telerik team
answered on 05 Mar 2010, 10:58 AM
Hello Iry,

We tested the case, but we could not replicate the problem locally. Here is the demo web site we used for our tests:

http://www.telerik.com/support/kb/aspnet-ajax/scheduler/sample-project-of-the-customizing-the-advanced-template-example.aspx

Please, try to modify this sample so that the problem can be seen and let us know what changes you have made to it.


Regards,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 08 Mar 2010, 05:04 AM
Peter, thanks for your reply.
Here are steps that i modify the sample code.

1. at the default.aspx, the schedular properties there, i add:
OnAppointmentInsert="rs_AppoinmentInsert" 
OnAppointmentUpdate="rs_AppoinmentUpdate" 
OnAppointmentDelete ="rs_AppointmentDelete"  
OnAppointmentCreated"rs_AppoinmentCreated" 
OnAppointmentDataBound =" rs_AppoinmentDataBound" 
EnableCustomAttributeEditing="True" 
CustomAttributeNames="Calendar,Location,Type" 
StartInsertingInAdvancedForm ="true" 
StarEditingInAdvancedForm = "true" 

2. Add in the function for insert, update, delete, created and databound for appointment at default.aspx.vb
3. At AdvanceForm.ascx, i added a drop down for each custom attribute that i set (Calendar, Location and Type).
4. get& set custom attributes' data at AdvanceForm.ascx.vb
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _ 
 Public Property Selectedloc() As String 
        Get 
            If cbLocation.SelectedValue <> "" Then 
                Return cbLocation.SelectedValue.ToString 
            Else 
                If cbLocation.Text = "" Then 
                    Return 0 
 
                Else 
                    Dim ssql As String = "INSERT INTO CAE_location (LocationID, LocationName, Status, AddDate, AddBy) VALUES (@param1, @param2, @param3, @param4, @param5)" 
 
                    Dim mClas As ExodusG2.dbOps = New ExodusG2.dbOps 
                    Dim AlIn As ArrayList = New ArrayList 
                    Dim sGuid As String = System.Guid.NewGuid().ToString 
                    AlIn.Add(sGuid) 
                    AlIn.Add(cbLocation.Text) 
                    AlIn.Add("1") 
                    AlIn.Add(Date.Now) 
                    AlIn.Add(HttpContext.Current.User.Identity.Name) 
                    mClas.execute_query(ssql, AlIn) 
                    Return sGuid 
                End If 
            End If 
 
        End Get 
 
        Set(ByVal value As String) 
            Dim selecteditem As RadComboBoxItem = New RadComboBoxItem() 
            Dim mClas As ExodusG2.dbOps = New ExodusG2.dbOps 
            'Dim dt As DataTable = New DataTable() 
            Dim alout As ArrayList = New ArrayList() 
            Dim AlIN As ArrayList = New ArrayList() 
 
            AlIN.Add(value) 
            alout = mClas.selectSingleRow("SELECT    LocationName, LocationID FROM  CAE_location WHERE     (LocationID = @param1)", AlIN, 2) 
 
            If alout.Count > 0 Then 
 
                selecteditem.Text = alout(0).ToString 
                selecteditem.Value = alout(1).ToString 
                selecteditem.Selected = True 
 
                cbLocation.Items.Add(selecteditem) 
            End If 
        End Set 
    End Property 
    <Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _ 
Public Property Selectedcalendar() As String 
        Get 
            Return cbCalendar.SelectedValue.ToString 
        End Get 
 
        Set(ByVal value As String) 
            For Each items As RadComboBoxItem In cbCalendar.items 
 
                If items.Value = value Then 
                    items.Selected = True 
                End If 
            Next 
        End Set 
    End Property 
 
 <Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _ 
Public Property eventType() As String 
        Get 
            Return cbType.SelectedValue.ToString 
        End Get 
 
        Set(ByVal value As String) 
            For Each items As RadComboBoxItem In cbType.items 
 
                If items.Value = value Then 
                    items.Selected = True 
                End If 
            Next 
        End Set 
    End Property 

5. Bind custome attributes to the schedular at default.aspx
Selectedcalendar='<%# Bind("Calendar") %>' 
                    Selectedloc='<%# Bind("Location") %>' 
                    eventType='<%# Bind("Type") %>' 

here is my source code, pls kindly refer to the source code if the way i explain it is confusing:
http://www.ximnet.com.my/upload/customTempSchedular.rar



0
Peter
Telerik team
answered on 11 Mar 2010, 05:38 PM
Hello Iry,

Thanks for the sample. However, we could not run it since it is missing the data base. We will need a fully runnable demo to be able to pinpoint the problem.


Regards,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 12 Mar 2010, 03:45 AM
Here is my updated application code file:
http://www.ximnet.com.my/upload/cae upload/Schedular_demoPage.rar

inside the web.config file, there are 2 connection string (connStr & connStrReadOnly).
the tool for decrypt/encrypt:
http://www.ximnet.com.my/aspnet35/setup/tripledes.aspx

Here is my db:
http://www.ximnet.com.my/upload/cae upload/db.zip

Thanks.

Regards,
Iry
0
Peter
Telerik team
answered on 17 Mar 2010, 11:39 AM
Hi Iry,

We recovered the database with the sql script you sent, but we are not sure how to modify your sample to make it run. In the web.config you have the following connection strings - connStr and connStrReadOnly, but searching the entire solution, I couldn't find where you use them. When running the project, I got the exception in the attached screen capture. We will need the exact steps to run your project locally.


Best wishes,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 18 Mar 2010, 02:19 AM
the tripledes.aspx is not in soution
but use the http://www.ximnet.com.my/aspnet35/setup/tripledes.aspx to help you decrypt/encrypt the connection string
after u replace the connection string, the project should be able to run

Regards,
Iry
0
Peter
Telerik team
answered on 19 Mar 2010, 02:14 PM
Hi Iry,

Yes, I used this converter, but i cannot use the connection string as it is. I replaced it with a connection string based on my local machine and server. But, the question is I don't see where and how you use these connection strings in your project.


Kind regards,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 22 Mar 2010, 10:19 AM
Hi Peter,

The connection string is in the dll to get DataTable and i use SQL query to get a DataTable to bind into the scheduler.
If you still fail to get the data, may be you can try to use normal way of getting the query into a DataTable.

Hope everything goes smoothly.
Thanks for your help.

Regards,
Iry

0
Iry Lee
Top achievements
Rank 2
answered on 23 Mar 2010, 01:17 PM
Hi Peter,

I'm concern about the progress. Are you able to run the application?

Regards,
Iry
0
Iry Lee
Top achievements
Rank 2
answered on 24 Mar 2010, 08:37 AM
Hi Peter,

The function below is the one i use for appointment insert, is this the correct way of storing recurrence data?
Anything else that i left out?
If it is wrong, how i should get and store the data in Vb?

Sub rs_AppoinmentInsert(ByVal o As Object, ByVal e As SchedulerCancelEventArgs) 
        Dim mclas As ExodusG2.dbOps = New ExodusG2.dbOps 
        Dim ALIN As ArrayList = New ArrayList() 
 
        ALIN.Add(System.Guid.NewGuid().ToString) 
        ALIN.Add(e.Appointment.Subject) 
        ALIN.Add(e.Appointment.Attributes("Location").ToString()) 
        ALIN.Add(Server.HtmlEncode(e.Appointment.Start)) 
        ALIN.Add(Server.HtmlEncode(e.Appointment.End)) 
        ALIN.Add(e.Appointment.Attributes("Calendar").ToString()) 
        ALIN.Add(e.Appointment.Attributes("Type").ToString()) 
        ALIN.Add(e.Appointment.Description) 
        ALIN.Add(e.Appointment.RecurrenceRule) 
        ALIN.Add(1) 
        ALIN.Add(Now.ToString()) 
        ALIN.Add(User.Identity.Name) 
 
        Dim ssql As String = "INSERT INTO CAE_EventList (EventID,EventSubject,LocationID,EventStartTime,EventEndTime,CalendarID,TypeID,EventDesc,RecurrenceRule,Status,AddDate,AddBy) VALUES (@param1, @param2,@param3,@param4,@param5,@param6, @param7, @param8, @param9, @param10, @param11,@param12)" 
        mclas.execute_query(ssql, ALIN) 
        Response.Redirect("default.aspx") 
    End Sub

And i notice something when i try to open the BooleanAttributeControl.ascx.vb from VS 2008 Pro, a window pop up about inconsistent line engdings. I made a print screen for it. Please help me to take a look.
Is that affect anything?
0
Peter
Telerik team
answered on 24 Mar 2010, 04:12 PM
Hi Iry,

Good news, after inspecting agin your code, we believe we found what the problem is. You should set DataRecurrenceField and DataRecurrenceParentKeyField  for RadScheduler:
Sub RadScheduler1_NeedDataSource()
        Dim mclas As ExodusG2.dbOps = New ExodusG2.dbOps
        Dim dt As DataTable = New DataTable
        Dim ALIN As ArrayList = New ArrayList
        ALIN.Clear()
        '* * *  
        RadScheduler1.DataKeyField = "EventID"
        RadScheduler1.DataSubjectField = "EventSubject"
        RadScheduler1.DataStartField = "EventStartTime"
        RadScheduler1.DataEndField = "EventEndTime"
        RadScheduler1.DataDescriptionField = "EventDesc"
    RadScheduler1.DataRecurrenceField = "RecurrenceRule"
    RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID"
  
        RadScheduler1.DataSource = dt
        ' RadScheduler1.DataSource = dtglobal
    End Sub

Let me know if this helped.


Greetings,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 25 Mar 2010, 05:05 AM
Hi Peter,

Billion thanks!
After setting DataRecurrenceField and DataRecurrenceParentKeyField, i manage to get the RecurrenceRule.

But when i add in the RecurrenceParentID to my insert appointment query, i failed to add the appointment.
(After enter the details of appointment and click save, the form didn't close and data didn't store into database.)
Steps that i did:
1. Add a column name RecurrenceParentID
2. Edit the query in rs_AppoinmentInsert() to store RecurrenceParentID
3. Add: ALIN.Add(e.Appointment.RecurrenceParentID)

Anything else that i need to do in order to get the RecurrenceParentID?

Regards,
Iry
0
Peter
Telerik team
answered on 26 Mar 2010, 04:19 PM
Hi Iry Lee,

Can you check for the data type of your RecurrenceParentID field. It should be int. Here is a help topic for rerence - Database Structure.

Best wishes,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 29 Mar 2010, 02:36 AM
Thanks for your reply, Peter.
Yes, my RecurrenceParentID field data type is Int.

Regards,
Iry
0
Peter
Telerik team
answered on 29 Mar 2010, 03:07 PM
Hello Iry,

The RecurrenceParentID should be null when inserting a new appointment. It is used only when creating exceptions. Please, refer to the help topic on Working with Recurring Appointments.


Best wishes,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 30 Mar 2010, 04:24 AM
Hi Peter,

Can we disable ajax for radschedular to see server-side errors instead of Ajax error ?

I have a problem when trying to edit the recurrence appointment.
Let's say i create the appointment at 30th March 2010, i set the appointment recur every tuesday and end by 14th April 2010.
So the appointment is appear 3 times in the calendar.

From the demo at http://demos.telerik.com/aspnet-ajax/scheduler/examples/outlook2007/defaultcs.aspx, i understand that when we edit recurrence appointment by choosing "Edit only this occurrence", then the edit form pop up with recurrence checkbox is unchecked and the recurrence option is hide.

But when i trying to edit:
1. the first appointment which is on 30th March by choosing "Edit only this occurrence". The edit form appear with Recurrence checkbox is checked and the recurrence options is shown.
2. the first appointment (30th March) by choosing "Edit the series". Error occured:
Webpage error details 
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0) 
Timestamp: Tue, 30 Mar 2010 03:22:01 UTC 
 
 
Message: Object doesn't support this property or method 
Line: 10 
Char: 13 
Code: 0 
URI: http://develop.alchemedia-01.ximnet.my/joycube/joycube/cae/default.aspx 
 
 
Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object. 
Line: 6 
Char: 62099 
Code: 0 
URI: http://develop.alchemedia-01.ximnet.my/joyCube/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_cp_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1103.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a4552b812-caf7-4129-9b53-8f199b5bce6c%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3a1e771326%3aaa288e2d%3a874f8ea2%3a650fdad%3aef9d9f4a%3a5aafb8ec%3aa51ee93e%3a59462f1%3ae330518b%3ac8618e41%3ae4f8f289 

3. For other occurence (6th Apr & 13th Apr), no matter Edit only this occurrence or Edit the series, Error occured too:
Webpage error details 
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0) 
Timestamp: Tue, 30 Mar 2010 03:23:16 UTC 
 
 
Message: Object doesn't support this property or method 
Line: 10 
Char: 13 
Code: 0 
URI: http://develop.alchemedia-01.ximnet.my/joycube/joycube/cae/default.aspx 
 
Message: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection. 
Parameter name: index 
Line: 6 
Char: 62099 
Code: 0 
URI: http://develop.alchemedia-01.ximnet.my/joyCube/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_cp_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1103.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a4552b812-caf7-4129-9b53-8f199b5bce6c%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3a1e771326%3aaa288e2d%3a874f8ea2%3a650fdad%3aef9d9f4a%3a5aafb8ec%3aa51ee93e%3a59462f1%3ae330518b%3ac8618e41%3ae4f8f289 

Anything can make these goes wrong? What i can do to solve these problem?

Regards,
Iry



0
Peter
Telerik team
answered on 01 Apr 2010, 03:22 PM
Hi Iry,

We are not really sure why this problem occurs. We couldn't actually run your demo. Our previous suggestion was based on just reviewing the code. I will forward this case to our development team and if they have ideas, we will follow up here.


Greetings,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 02 Apr 2010, 02:56 AM
Thanks a lot! I'll wait for the development team then.
Hope they will bring me good news.

one more thing i notice about recurrence appointment is when i try to delete an occurence only, after the schedular reload that occurence is still there.

Regards,
Iry
0
Iry Lee
Top achievements
Rank 2
answered on 06 Apr 2010, 08:11 AM
Hi Peter,
Any news from development team?

Regards,
Iry
0
Iry Lee
Top achievements
Rank 2
answered on 09 Apr 2010, 09:08 AM
Hi Peter,
Any news from development team?

Regards,
Iry
0
Peter
Telerik team
answered on 09 Apr 2010, 12:06 PM
Hi Iry Lee,

Unfortunately, we haven't been able to find out something new about this problem which could provide you with more hints.

Regards,
Peter
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
Iry Lee
Top achievements
Rank 2
answered on 19 Apr 2010, 04:15 AM
Hi Peter,

10 days passed. Hope can get good news from you.
Thanks

Regards,
Iry
Tags
Scheduler
Asked by
Iry Lee
Top achievements
Rank 2
Answers by
robertw102
Top achievements
Rank 1
Iry Lee
Top achievements
Rank 2
Peter
Telerik team
Share this question
or