Recurrence from DB other than SQL?

5 posts, 0 answers
  1. Mitchell
    Mitchell avatar
    24 posts
    Member since:
    Nov 2010

    Posted 07 Jan 2011 Link to this post

    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?

  2. Mitchell
    Mitchell avatar
    24 posts
    Member since:
    Nov 2010

    Posted 07 Jan 2011 Link to this post

    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?
  3. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 10 Jan 2011 Link to this post

    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.
  4. Mitchell
    Mitchell avatar
    24 posts
    Member since:
    Nov 2010

    Posted 10 Jan 2011 Link to this post

    Thanks!

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

  5. Mitchell
    Mitchell avatar
    24 posts
    Member since:
    Nov 2010

    Posted 10 Jan 2011 Link to this post

    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
Back to Top