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

Recurrence from DB other than SQL?

4 Answers 77 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mitchell
Top achievements
Rank 1
Mitchell asked on 08 Jan 2011, 02:47 AM
Is it possible to bind the scheduler to a dataview that isn't populated by SQL server? I'm familiar with the UDF.. but I work on postgres, so that won't work from me. If not, is there another solution here that I could use?

Right now I'm doing a select on the appointments table, and I see my recurrence rule column is saving properly:

"DTSTART:20110107T171000Z
DTEND:20110107T173000Z
RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
"
But I can't seem to figure out how I can get the other days to see that recurring appointment.

Any suggestions?

4 Answers, 1 is accepted

Sort by
0
Mitchell
Top achievements
Rank 1
answered on 08 Jan 2011, 04:48 AM
I've discovered my problem has nothing to do with my dataview. It's that I'm using datasource.

I was originally setting the datasource in Page_Load, under (!IsPostBack), but I have read now that doesn't work.

So I followed the example that it needs to be set outside in the On_Init area, but when I do that, I can't use get a handle on what day of the week the calender is set to until the next postback.

IE, if "today" is friday, and I click "next day", .net still thinks it's friday until I click through to sunday.

The problem is that I'm trying to set the business hours programmatically depending on what day it is, IE:

switch (currentDay) {
            case DayOfWeek.Monday:
                radAppointmentsTech.DayStartTime = new TimeSpan(8, 0, 0);
                radAppointmentsTech.DayEndTime = new TimeSpan(19, 0, 0);
                radAppointmentsTech.WorkDayStartTime = new TimeSpan(8, 0, 0);
                radAppointmentsTech.WorkDayEndTime = new TimeSpan(19, 0, 0);
                break;

            case DayOfWeek.Tuesday:
                radAppointmentsTech.DayStartTime = new TimeSpan(8, 0, 0);
                radAppointmentsTech.DayEndTime = new TimeSpan(20, 0, 0);
                radAppointmentsTech.WorkDayStartTime = new TimeSpan(8, 0, 0);
                radAppointmentsTech.WorkDayEndTime = new TimeSpan(20, 0, 0);
                break;

So that doesn't work because the postback is one click behind.

Any thoughts?
0
Peter
Telerik team
answered on 10 Jan 2011, 02:58 PM
Hi Mitchell,

You can parse the recurrence rule manually as shown in this kb article:

http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-display-all-radscheduler-appointments-in-gridview.aspx


Kind regards,
Peter
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.
0
Mitchell
Top achievements
Rank 1
answered on 10 Jan 2011, 02:59 PM
Thanks!

That answers my first post, but what about the 2nd, with regards to the postbacks and setting the work hours, not working right? :)

0
Mitchell
Top achievements
Rank 1
answered on 10 Jan 2011, 03:10 PM
Solved my own problem again.

I put my "set_work_day" function in like this:

protected override void OnPreRender(EventArgs e) {
        base.OnPreRender(e);
        set_work_day();
    }

and all was well!

Mitch
Tags
Scheduler
Asked by
Mitchell
Top achievements
Rank 1
Answers by
Mitchell
Top achievements
Rank 1
Peter
Telerik team
Share this question
or