[]
public event OwnerDrawCellEventHandler OwnerDrawCell
Type | Description |
---|---|
OwnerDrawCellEventHandler | Fires before the grid draws a cell, when the property is set to . |
The OwnerDrawCell event only fires when the DrawMode property is set to OwnerDraw.
You can use this event to customize the appearance of any cell in the grid. The event allows three main types of customization:
The OwnerDrawCell event also fires when the grid auto sizes rows or columns (see the AutoSizeRows(int, int, int, int, int, AutoSizeFlags) and AutoSizeCols(int, int, int, int, int, AutoSizeFlags) methods). This is done because the grid needs to measure the cell using the same text, image, and style parameters that are used to render it. In these cases, the Measuring parameter is set to true and the Bounds rectangle is empty.