Skip to main content

How to: Import Data from iCalendar

  • 2 minutes to read

#Import Data on Button Click

The following example demonstrates how to load appointment data to a scheduler from the iCalendar format on a button click. To do this, add a reference to the DevExpress.XtraScheduler.v14.2.iCalendarExchange.dll library (you can find this assembly file in C:\Program Files (x86)\DevExpress 14.2\Components\Bin\Silverlight), create an iCalendarImporter class instance in the Button.Click event handler, pass the scheduler storage accessed via SchedulerControl.GetCoreStorage to its constructor, and call the AppointmentImporter.Import method with a parameter set to a stream that specifies the .ics file selected by an end-user.

As a result, clicking the Import button will invoke the Open dialog where an end-user can select an iCalendar file to import appointment data to a scheduler.

DXScheduler_iCalendar_Import

#Import Data on iCalendar File Drop

The following example demonstrates how to provide end-users with the capability to import appointment data to a scheduler from the iCalendar format by dragging an .ics file onto a scheduler area. To do this, add a reference to the DevExpress.XtraScheduler.v14.2.iCalendarExchange.dll library (you can find this assembly file in C:\Program Files (x86)\DevExpress 14.2\Components\Bin\Silverlight), create an iCalendarImporter class instance in the SchedulerControl.Drop event handler, pass the scheduler storage accessed via SchedulerControl.GetCoreStorage to its constructor, and call the AppointmentImporter.Import method with a parameter set to a stream that specifies the iCalendar file dropped by an end-user.

As a result, end-users can populate a scheduler with appointment data by dragging and dropping an iCalendar file onto the scheduler area.

DXScheduler_iCalendar_Import_Drop

See Also