Occurs when drawing each day cell in the calendar.
[DXCategory("CustomDraw")] public event CustomDrawDayNumberCellEventHandler CustomDrawDayNumberCell
<DXCategory("CustomDraw")> Public Event CustomDrawDayNumberCell As CustomDrawDayNumberCellEventHandler
The CustomDrawDayNumberCell event's data class is CustomDrawDayNumberCellEventArgs. The following properties provide information specific to this event:
|BackgroundElementInfo||Gets or sets the skin element that is used to paint the background of the currently processed cell.|
|Bounds||Gets the painted element’s bounding rectangle.|
|Cache||Gets an object that specifies the storage for the most used pens, fonts and brushes.|
|ContentBounds||Gets the bounds of the cell’s content (text).|
|Date||Gets the painted cell’s value.|
|Disabled||Gets whether the painted cell is disabled.|
|Graphics||Gets an object used to paint.|
|Handled||Gets or sets a value specifying whether default painting is prohibited.|
|Highlighted||Gets whether the currently processed cell is under the mouse cursor.|
|Holiday||Gets whether the painted cell corresponds to Saturday or Sunday.|
|Inactive||Gets whether the painted cell belongs to the previous or next month.|
|IsPressed||Gets whether the cell is currently pressed.|
|IsSpecial||Gets whether the cell corresponds to a “special” date.|
|Selected||Gets a value indicating whether the processed day number cell is selected.|
|State||Gets the current cell’s state.|
|Style||Gets the painted date cell’s appearance settings.|
|Today||Gets whether the painted cell corresponds to Today’s date.|
|View||Gets or sets the current View of data in the dropdown window.|
|ViewInfo||Contains information used for painting the current cell.|
The event data class exposes the following methods:
|DefaultDraw()||Draws the processed cell according to the default algorithm.|
The CustomDrawDayNumberCell event fires when a day cell in the calendar is about to be painted. Handle this event, for instance, if you wish to custom paint particular dates, e.g. by highlighting them.
If you custom paint day cells using the CustomDrawDayNumberCell event, set the CustomDrawDayNumberCellEventArgs.Handled parameter to true to prevent the default painting mechanism from being invoked after your CustomDrawDayNumberCell event handler is completed. Otherwise, your painting will be overridden by the default painting mechanism.
You can use drawing methods provided by the e.Graphics object to paint custom information in your CustomDrawDayNumberCell event handler.
Alternatively, you can use drawing methods provided by the e.Cache or e.Style objects. If using the methods provided by the e.Cache or e.Style objects, ensure that the static DevExpress.Utils.Paint.XPaint.ForceGDIPlusPaint method is called on the application startup. Otherwise, you may observe incorrect painting on some operating systems (e.g. Windows 7).