Back to Devexpress

How to: Hide Grid Lines in the View

windowsforms-2297-controls-and-libraries-scheduler-examples-appearance-how-to-hide-grid-lines-in-the-view.md

latest2.7 KB
Original Source

How to: Hide Grid Lines in the View

  • Dec 15, 2019

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.

csharp
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;
}
vb
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

CustomDrawAppointment

CustomDrawAppointmentBackground

DrawDefault()

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

How to: Custom Paint Appointments