windowsforms-2297-controls-and-libraries-scheduler-examples-appearance-how-to-hide-grid-lines-in-the-view.md
The following example demonstrates how to hide grid lines in the Scheduler view. It handles the SchedulerControl.CustomDrawTimeCell event. Cell rectangles are painted with the specified brushes, the borders are not painted.
public static void scheduler_CustomDrawTimeCell(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e)
{
// Get the cell to draw.
SelectableIntervalViewInfo cell =
e.ObjectInfo as SelectableIntervalViewInfo;
if (cell != null) {
// Draw the cell.
Brush myBrush = (cell.Selected) ? SystemBrushes.Highlight : SystemBrushes.Window;
e.Cache.FillRectangle(myBrush, cell.Bounds);
}
e.Handled = true;
}
Public Shared Sub scheduler_CustomDrawTimeCell(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.CustomDrawObjectEventArgs)
' Get the cell to draw.
Dim cell As SelectableIntervalViewInfo = TryCast(e.ObjectInfo, SelectableIntervalViewInfo)
If cell IsNot Nothing Then
' Draw the cell.
Dim myBrush As Brush = If(cell.Selected, SystemBrushes.Highlight, SystemBrushes.Window)
e.Cache.FillRectangle(myBrush, cell.Bounds)
End If
e.Handled = True
End Sub
See Also
AppointmentViewInfoCustomizing
CustomDrawAppointmentBackground
How to: Display Custom Images for Appointments
How to: Hide the Reminder (Bell) Icon for Outdated Appointments in a Series
How to: Custom Paint Day Headers
How to: Hide Grid Lines in the View