|Applies To:||Schedule for WinForms|
The 2007 v1 release of ComponentOne Studio Enterprise introduced a new product for developing Outlook-style desktop scheduling applications. Schedule for WinForms includes two visual components: C1Schedule and C1Calendar. C1Schedule displays appointments in day, week, work week, or monthly views. It also includes a built-in data layer that automatically manages one-time or recurring appointments with reminders, as well as related collections such as contacts, categories, labels, and resources. C1Calendar provides navigation and date range selection for an associated C1Schedule control. Both controls include AutoFormat settings for applying the latest visual styles.
This article illustrates some of the features of these new components using an application that implements customizable views of the sessions for the VSLive! conference in San Francisco, March 25-29, 2007. The application is available via ClickOnce install and as a source code download.
NOTE: The application includes an Access database that contains the conference agenda, session times, and speaker biographies. Although this information was accurate at the time of this writing, it is subject to change. Please visit the following site for the official conference agenda:
To see the above application in action, click the following link to start a ClickOnce installation (requires the .NET Framework 2.0):
To download the source code for the application (in C#), click the following link:
You will also need to download an evaluation version of Studio Enterprise 2007 v1 (or update an earlier version) to build and run the application.
This sample uses the new C1Schedule and C1Calendar components to display the conference agenda and sessions for VSLive! San Francisco 2007. The C1NavBar, C1FlexGrid, and C1TrueDBGrid components are also featured. As the preceding figure illustrates, the application always displays a C1NavBar control in the left pane, and a C1Schedule control in the right pane. Depending upon which C1NavBar button is selected, the inner content pane displays a different set of controls for filtering or changing the view of the associated C1Schedule control.
The application starts in Sessions view and displays all appointments (sessions) for the first full day of the conference. To see more information for a particular session, double-click its appointment bubble to open a dialog similar to the following:
In this application, the default labels (Business, Personal, Vacation, etc.) have been replaced by a list of the conference tracks. Likewise, the default categories have been replaced by subject matter descriptions (Advanced, Intermediate, Introductory, Keynote). The name of the speaker appears in the text box next to the Contacts button, and clicking this button opens a list of all speakers.
The C1Calendar control in the left pane is used to navigate the associated C1Schedule control in the right pane. Click a bold date in the calendar (March 25-29) to display the scheduled events for that date. Hold down the Shift key while clicking to select consecutive dates, the Ctrl key to select discontiguous dates. Notice that the C1Schedule control adjusts to display additional columns for each selected date.
On the busiest days, as many as ten sessions run concurrently, so you will need to maximize the application window in order to be able to read the appointment bubbles. Alternatively, you can use the multi-colored bands to filter the sessions by track. To view sessions for a single track, click the name of the track. Use the adjacent check boxes to add tracks to or remove tracks from the current view.
The multi-colored bands are actually the rows of a C1FlexGrid control in owner-draw mode.
Another way to view the sessions is to select the name of an individual speaker. In this view, a C1TrueDBGrid control in GroupBy mode is used to organize the list of speakers alphabetically by the first letter of the last name. The handler for the grid’s RowColChange event filters the underlying data source and configures the C1Schedule control to display only those days where the selected speaker is making a presentation.
Conference Agenda view
This view does not display individual sessions, but uses all day events to show which tracks are assigned to which days. Use the radio buttons in the left pane to switch between day, week, and month views. The underlying code simply sets the ViewType property of C1Schedule to the corresponding enumerated value. (A fourth option, work week, is not used in this application.)
By default, weekly view uses the Office 2007 presentation style, which resembles the multi-column grid in the preceding figure. This application overrides the default value of the WeekViewStyle property to select the Office 2003 format, which produces a more readable display.
Interacting with C1Schedule
In any view, you can create a new appointment or all day event by double-clicking in the unoccupied area of a data cell, or by right-clicking the control to open one of the built-in context menus, as shown in the following figure. The context menu also provides commands for recurring appointments, date navigation, and import/export of XML, iCal, and binary files.
Although the feature is disabled in this application, C1Schedule lets you drag existing appointments from one day or time slot to another. You can use the EditOptions property to control whether end users can drag, create, edit, or delete appointments.
ComponentOne Schedule for WinForms makes it easy to add Outlook-style appointments with reminders to your WinForms applications. As the sample application illustrates, you can use the built-in data layer to map existing data tables to C1Schedule collections. You can also use the import/export feature to store schedule data in a file without the overhead of a data source.
The sample application also demonstrates how to use a variety of ComponentOne controls in concert. For example, a C1NavBar can host a C1Calendar, which in turn can drive navigation and selection for a C1Schedule control.