$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Scheduler control for Windows Forms
Create rich Outlook style functionality and add rich scheduling interfaces to C# Windows application
Home > WinForms UI Controls > User Manual > Format Cells in Scheduler in C#

Formatting Cells in KetticScheduler in C#.NET

KetticScheduler control is capable of formatting cells to set the visual elements, which keep the appointment and view data. The customization of cells formatting is achieved through the CellFormatting event. When we create a SchedulerCellElement, the CellFormatting event is fired at the position where the cells are necessary to be shown. The arguments of the CellFormatting event include a reference to the cell element for the users to customize the properties. In the C# tutorial below, we can find how to customize the cells properties in the KetticScheduler.

Data Cells included in KetticScheduler control

The SchedulerCellElement allows the users to create data cells with the KetticScheduler control. There are a few properties available for the users to customize the data cell, including Date for returning the date, IsToday for setting current cell to today, IsWorkTime for setting current cell to be a work time slot, and IsWholeHour for customize the cell to present a whole hour.

Header Cells of KetticScheduler for WinForms

The header cells are created via the SchedulerHeaderCellElement, which derives from the SchedulerCellElement, so we can customize the header cells through the properties of the SchedulerCellElement. Additionally, there is one more property available, the IsVertical for returning the cell element in vertical.

C# Format Data Cells in KetticScheduler control

The following C# code demonstrates how to format the data cells. In this example, we change the cell which stands for a specific day to be Yellow.

void ketticScheduler1_CellFormatting1(object sender, Kettic.WinForms.UI.SchedulerCellEventArgs e)
{
if (e.CellElement.Date.Month == 6 && e.CellElement.Date.Day == 15)
{
if (!(e.CellElement is SchedulerHeaderCellElement))
{
e.CellElement.BackColor = Color.Yellow;
}
}
}
To reset the data cells, we can change the BackColor property with the C# code below.

void ketticScheduler1_CellFormatting2(object sender, Kettic.WinForms.UI.SchedulerCellEventArgs e)
{
if (e.CellElement.Date.Month == 6 && e.CellElement.Date.Day == 15)
{
if (!(e.CellElement is SchedulerHeaderCellElement))
{
e.CellElement.BackColor = Color.Yellow;
}
}
else
{
if (!(e.CellElement is SchedulerHeaderCellElement))
{
e.CellElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local);
}
}
}

C# Format Header Cells in KetticScheduler control

The header cells are mainly used to display the text of the current date and contain all day appointments. The following C# code will customize the header cells which show the text to be green and the header cell which contains all day appointment to be red.
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls