# Scheduler for WinForms Top Tips

Understand the solution tips compiled from frequently asked user questions in the Scheduler for WinForms online forum.

## Content



The following tips were compiled from frequently asked user questions posted in the **Scheduler for WinForms** [online forum](https://developer.mescius.com/forums).

### Tip 1: Disable Updating C1Schedule while Filling the Underlying Data Source

When you bind the [C1Schedule](/componentone/docs/win/online-schedule/) control to a data source, every change in the underlying data source forces the C1Schedule control to update. This could affect performance, especially when loading a large amount of data. To disable updating, you can call the [BeginUpdate](/componentone/docs/win/online-schedule/) method before data operations and call the [EndUpdate](/componentone/docs/win/online-schedule/) when the operations are complete. For example:

```csharp
// Disable updating    
this.c1Schedule1.BeginUpdate();   
// Fill datasets with data   
this.productsTableAdapter.Fill(this.nwindDataSet1.Products);   
this.employeesTableAdapter.Fill(nwindDataSet.Employees);   
this.appointmentsTableAdapter.Fill(nwindDataSet.Appointments);   
// Enable updating   
this.c1Schedule1.EndUpdate();
```

### Tip 2: Use the CustomData and Tag Properties to Keep Additional Information

If needed, you can store additional appointment information in the [C1Schedule](/componentone/docs/win/online-schedule/) control. The [Appointment](/componentone/docs/win/online-schedule/) class has two properties which can be used to keep custom information:

*   The [Tag](/componentone/docs/win/online-schedule/) property can be used at run time for storing any information. This property value is not used for appointment serialization, so, for example, it won't be saved at export or via [AppointmentStorage](/componentone/docs/win/online-schedule/) binding.
*   The [CustomData](/componentone/docs/win/online-schedule/) property is serialized with other appointment properties. It isn't used by the C1Schedule control; you can use it to keep your data associated with appointment. This property is serialized into an XML format and it is saved into underlying data source if mapping for Appointment properties is set. It is not retained when exporting to or importing from iCal format files.

### Tip 3: Extracting All Appointments for Particular Period of Time

To get all Appointment objects for particular time period, use appropriate overload of [GetOccurrences](/componentone/docs/win/online-schedule/) method. This method returns all events in the specified period, including recurring events occurrences. For example:

```csharp
AppointmentList todayAppointments = c1Schedule1.DataStorage.AppointmentStorage.Appointments.GetOccurrences(DateTime.Today, DateTime.Today.AddDays(1));
```

### Tip 4: Customize Appointment Appearance

You can change appointment appearance in the [BeforeAppointmentFormat](/componentone/docs/win/online-schedule/) event's event handler. The [Text](/componentone/docs/win/online-schedule/) property accepts HTML to customize the display in the control. Or example, you can use the following code to insert a custom image:

```csharp
e.Text = "<div><img src=res://myIcon.gif/></div>";
```

In the above code the myIcon.gif image will be extracted from your application resources and inserted into appointment. You can change other [BeforeAppointmentFormatEventArgs](/componentone/docs/win/online-schedule/) properties as well. Note that this information won't be saved to underlying datasource, you should handle appointment information and apply formatting from your code at run time. For example:

```csharp
private void c1Schedule1_BeforeAppointmentFormat(object sender, BeforeAppointmentFormatEventArgs e)   
{   
    if (e.Appointment.ReminderSet)   
    {   
    e.Icons |= AppointmentIcons.Reminder;   
    }   
    if (!String.IsNullOrEmpty(e.Text) &&   
        e.Appointment.Importance == ImportanceEnum.High)   
    {   
        e.Text = "<div style=\"color:red\"><b>" + e.Text + "</b></div>";   
    }   
    if (String.IsNullOrEmpty(e.Text) &&   
        !String.IsNullOrEmpty(e.Appointment.Body))   
    {   
        e.Text = "<a href=more>More info...</a>";   
    }   
    else   
    {   
        e.Text = "<div><img src=res://myIcon.gif/></div>";   
    }   
}
```

### Tip 5: Customize Appointment ToolTips

Appointment ToolTips can include HTML markup, allowing you to customize ToolTips easily. You can change a ToolTip in the [BeforeAppointmentTooltipShow](/componentone/docs/win/online-schedule/) event's event handler. For example:

```csharp
private void c1Schedule1_BeforeAppointmentTooltipShow(object sender, BeforeAppointmentTooltipShowEventArgs e)   
{   
    e.Text = "<img src='res://c1icon_bottom3.gif'>" + "<br/>" +   
    e.Appointment.Start.ToShortTimeString() +   
    " <b>" + e.Appointment.Subject + "</b><br/>" + e.Appointment.Body;   
}
```