CustomDrawDayNumberCellEventArgs.DefaultDraw() Method
Draws the processed cell according to the default algorithm.
Namespace: DevExpress.XtraEditors.Calendar
Assembly: DevExpress.XtraEditors.v20.2.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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