A GridDrawCellBackgroundEventArgs that contains the event data.

OnDrawCellBackground Method (GridCellRendererBase)

Called to draw / erase the background for a cell.
Protected Overridable Sub OnDrawCellBackground( _
   ByVal e As GridDrawCellBackgroundEventArgs _
Dim instance As GridCellRendererBase
Dim e As GridDrawCellBackgroundEventArgs
protected virtual void OnDrawCellBackground( 
   GridDrawCellBackgroundEventArgs e


A GridDrawCellBackgroundEventArgs that contains the event data.
This method is called for covered cells and bannered cells. For regular cells, you can force OnDrawCellBackground to be called by assigning BrushInfo.Empty to the Interior property of a GridStyleInfo. You can do this for example in OnPrepareViewStyleInfo.

Otherwise OnDrawCellBackground will not be called for regular cells because of internal drawing optimizations within the grid. By default the grid optimizes drawing such that the background of neighboring cells with the same color is drawn in one operation.

The method will also not be called if you handle the GridControlBase.DrawCellBackground event of GridControlBase and set e.Cancel = true.

The default version of this method fills the entire background as specified with Interior and also draws the image specified with BackgroundImage.


Syncfusion.Grid.Windows: 18.2460.0.44

See Also