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

Multiple appointments through RadScheduler control - Exporting ICS File

1 Answer 105 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 07 Feb 2012, 09:31 PM
Hi 

I'm working on "Add to Calendar" feature from my Sharepoint webpart (created using VS2010). If I want to include  multiple breakdown appointments  (For Ex, one for today between 9.00 a.m - 11 a.m & one for tomorrow between 3.00 p.m - 5.00 p.m), How do I do that?
The following code works for a single appointment. Its creating an additional calendar  if I have more that one appointment. 
Instead I should be able to update my existing calendar with the multiple appointments.

Could you please assist me how to do this?

Here is part of my code 

                //........
                EventSessions = from eventobj1
in context.EventSessions
   where eventobj1.Event.Id == eventid
   select eventobj1;
      foreach (EventSessionsItem session in EventSessions)
      {
         Appointment _appointment = new Appointment();
 
         editor.Content = session.Event.EventDetails;
         _appointment.Subject = session.Title;
         _appointment.Description = Server.HtmlDecode(editor.Text);
         _appointment.Start = session.DateOfSession.Value; 
         _appointment.End = dtStart.AddHours(session.SessionDuration.Value); 
                     sbICSFile.Append(RadScheduler.ExportToICalendar(_appointment));
      }
      WriteCalendar(sbICSFile.ToString());

       


private
void WriteCalendar(String data)
{
HttpResponse response = Page.Response;
response.Clear();
response.Buffer =
true;
response.ContentType =
"text/calendar";
response.ContentEncoding = Encoding.UTF8;
response.Charset =
"utf-8";
response.AddHeader(
"Content-Disposition", "attachment;filename=\"Calendar.ics\"");
response.Write(data);
response.End();
}

1 Answer, 1 is accepted

Sort by
0
Cat Cheshire
Top achievements
Rank 1
answered on 12 Feb 2012, 06:27 PM
How exactly you populate the scheduler with data?
Why are you overriding the response?
Tags
Scheduler
Asked by
John
Top achievements
Rank 1
Answers by
Cat Cheshire
Top achievements
Rank 1
Share this question
or