Skip to main content
A newer version of this page is available.
All docs
V21.1

CustomDrawDayNumberCellEventArgs.DefaultDraw() Method

Draws the processed cell according to the default algorithm.

Namespace: DevExpress.XtraEditors.Calendar

Assembly: DevExpress.XtraEditors.v21.1.dll

NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Navigation

Declaration

public void DefaultDraw()

Example

The example below shows how to draw a custom image in a cell of the DateEdit control.

The DateEdit.DrawItem event handler calls the DefaultDraw() method to draw the processed cell according to the default algorithm. Then the handler uses the GraphicsCache object to draw a custom image over the default rendering.

For a source of images, the example uses an ImageCollection that is populated in the designer.

using DevExpress.XtraEditors.Calendar;

private void dateEdit1_DrawItem(object sender, DevExpress.XtraEditors.Calendar.CustomDrawDayNumberCellEventArgs e) {
    if (e.Date.Date == DateTime.Now.Date) {
        e.DefaultDraw();
        e.Cache.DrawImage(imageCollection1.Images[2], e.Bounds.X + 2, e.Bounds.Y + 2);
    }
}
See Also