RadSchedulre datasource -DataTable

8 posts, 0 answers
  1. H.
    H. avatar
    33 posts
    Member since:
    Feb 2011

    Posted 22 Aug 2011 Link to this post

    Hi Guys, I have a RadScheduler that use a Datatable as Datasource.

    DataTable Structure
     DataTable dtAppointments = new DataTable("Appointments");
                dtAppointments.Columns.Add("ItemID", typeof(int));
                dtAppointments.Columns.Add("Title", typeof(string));
                dtAppointments.Columns.Add("CalendarType", typeof(string));
                dtAppointments.Columns.Add("StartDate", typeof(DateTime));
                dtAppointments.Columns.Add("EndDate", typeof(DateTime));
                dtAppointments.Columns.Add("hasEndDate", typeof(bool));
                dtAppointments.Columns.Add("Description", typeof(string));
                dtAppointments.Columns.Add("Location", typeof(string));
                dtAppointments.Columns.Add("RecurrenceRule", typeof(string));
                dtAppointments.Columns.Add("RecurrenceParentID", typeof(string));
                dtAppointments.Columns.Add("IsRecurrence", typeof(bool));

    Everything works great until I need to use the DataRecurrenceField field. I use the value "DTSTART:20110801T000000Z\r\nDTEND:20110802T000000Z\r\nRRULE:FREQ=WEEKLY;COUNT=20;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SU\r\n"
    in the column RecurrenceRule as a string but when the calendar is loaded the item is add in all days of the month. What I did wrong?
     RadScheduler1.DataSource =Call the method that create the DataTable with the data.
      RadScheduler1.DisplayRecurrenceActionDialogOnMove = true;
                        RadScheduler1.DataSubjectField = "Title";
                        RadScheduler1.DataStartField = "StartDate";
                        RadScheduler1.DataEndField = "EndDate";
                        RadScheduler1.DataKeyField = "itemID";
                        RadScheduler1.DataRecurrenceField = "RecurrenceRule";
                        RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID";
    RadScheduler1.DataBind();

    I also used a static text that represent "Monday, 20 June 2011 12:00 AM - Friday, 31 January 2025 11:59 PM (Central Time Zone)
    Repeat weekly every 5 weeks on Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday"

    RecurrenceRule 
    "DURATION:P1D\r\nDTSTART;VALUE=DATE:20110620\r\nRRULE:FREQ=WEEKLY;INTERVAL=5;BYDAY=SU,MO,TU,WE,TH,FR,SA;WKST=MO\r\n"

    I need your help!!
    Hank


  2. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 25 Aug 2011 Link to this post

    Hi H.,

    I inspected the recurrence rule that you posted and everything worked as expected.

    For more information you can consult with this help topic and inspect the exact recurrence rule in the ICalender Export demo where you can open the .ics file with Nodepad and see what is the generated rule.

    Hope this is helpful.
     
    All the best,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. H.
    H. avatar
    33 posts
    Member since:
    Feb 2011

    Posted 29 Aug 2011 Link to this post

    I also the recurrencerule and it is ok. The problem is when I am databinding the schudeler with the datatable. Should i have to do extra step to be able to have the recurrence event ? What should be the recurrenceparent id? I pretty sure the recurrencerules is correct because I get the string from the icalendar and I validated the rule string with the recurrencerule.tryparce and it is valid! Please help me I really need to fix this! Best Regards, Hank
  4. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 30 Aug 2011 Link to this post

    Hello H.,

    The ResurrenceParentID should be an "int" not a "string" type. Please consult with this help topic.

    Hope this helps.

    All the best,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  5. H.
    H. avatar
    33 posts
    Member since:
    Feb 2011

    Posted 06 Sep 2011 Link to this post

    Thank you!! For the information. Still is not clear for me what value of the Calendar List in Sharepoint should match with ResurrenceParentID. what I did was to take iCalendar Explorer and covert the Recurrence Data to Recurrence Rule but when the information is presented in the calendar the events are duplicate in all days. Looks like RadScheduler cannot interpret the RecurrenceRule string, which is valid and correct.

    does somebody have any ideas how to fix this? I use Datatable as Datasource in the RadScheduler control.

    Thx
    HANK
  6. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 09 Sep 2011 Link to this post

    Hello Hank,

    You can refer to this Code Library.

    Hope this will help.

    Greetings,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  7. H.
    H. avatar
    33 posts
    Member since:
    Feb 2011

    Posted 09 Sep 2011 Link to this post

    Hi Plamen, Thanks for the reply. I already used the code in Code Library. However, Want to use the RecuerrenceRule because I think is better for performances.

    Do you have a example that use Datatable as datasource and use the DataRecurrenceField and DataRecurrenceParentKeyField?

    I have the RRULE and is valid but when I use the DataRecurrenceField the appointment is duplicate in all the weeks of the month. Still It is not have clear for me how to deal with the DataRecurrenceParentKeyField. I tried to use the ListID but it did work, I tried to set to null no luck neither.

    I need your help and as soon as possible. This is how I define the RadScheduler. GetCalendarItems() return a dataTable. the DataTable definition is in the end of this reply. Thank for any help you can give me!!

    NOTE: I GET THE INFORMATION FROM A CALENDAR LIST IN SHAREPOINT

    rschMyCalendar.SelectedView =

     

    SchedulerViewType.MonthView;

     

    rschMyCalendar.DataSource = GetCalendarItems();

    rschMyCalendar.DisplayRecurrenceActionDialogOnMove =

     

    true;

     

    rschMyCalendar.DataSubjectField =

     

    "Title";

     

    rschMyCalendar.DataDescriptionField =

     

    "Description";

     

    rschMyCalendar.DataStartField =

     

    "StartDate";

     

    rschMyCalendar.DataEndField =

     

    "EndDate";

     

    rschMyCalendar.DataKeyField =

     

    "itemID";

     

    rschMyCalendar.DataRecurrenceField =

     

    "RecurrenceRule";

     

    rschMyCalendar.DataRecurrenceParentKeyField =

     

    "RecurrenceParentID";

     

    rschMyCalendar.ToolTip =

     

    "Description";

     

     

    rschMyCalendar.DataBind();



     

     

    DataTable dtAppointments = new DataTable("Appointments");

     

    dtAppointments.Columns.Add(

     

    "ItemID", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "Title", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "CalendarType", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "StartDate", typeof(DateTime));

     

    dtAppointments.Columns.Add(

     

    "EndDate", typeof(DateTime));

     

    dtAppointments.Columns.Add(

     

    "hasEndDate", typeof(bool));

     

    dtAppointments.Columns.Add(

     

    "Description", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "Location", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "RecurrenceRule", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "RecurrenceParentID", typeof(Int64));

     

    dtAppointments.Columns.Add(

     

    "IsRecurrence", typeof(bool));

     

    dtAppointments.Columns.Add(

     

    "Color", typeof(string));

     

    dtAppointments.Columns.Add(

     

    "NavigationUrl",typeof(string));

     


  8. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 15 Sep 2011 Link to this post

    Hello H.,

    When you create recurring appointments – the appointment that has been created first is called “master”. The RecurrenceParentID of the recurring appointments is set to the ID of this master, and the master itself has no RecurrenceParentID.
    Please take a look at this help article again and let us know if you have additional questions.
    Additionally you can take a look at this online demo.

    Best wishes,
    Kalina
    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
Back to Top