ComponentOne FlexGrid for WinForms
DrawCell(DrawCellFlags) Method

C1.Win.C1FlexGrid Namespace > OwnerDrawCellEventArgs Class > DrawCell Method : DrawCell(DrawCellFlags) Method
DrawCellFlags that specifies the parts of the cell.
Causes the grid to paint parts of the cell (background, foreground, border, etc.)
Syntax
'Declaration
 
Public Overloads Sub DrawCell( _
   ByVal flags As DrawCellFlags _
) 
public void DrawCell( 
   DrawCellFlags flags
)

Parameters

flags
DrawCellFlags that specifies the parts of the cell.
Remarks

This method is typically called in OwnerDrawCell handlers when the code intends to draw some elements of the cell but not everything.

For example, the code may want to draw a custom border only. In this case, it could call e.DrawCell(DrawCellFlags.Background | DrawCellFlags.Content) to draw the cell background and content, and later draw the custom border. Or the code could want to draw a custom marker in a cell (like a note indicator in Excel). In this case, it should call e.DrawCell() to draw the entire cell, and later add the note marker (little red triangle on the top right corner of the cell).

If the owner-draw code draws the entire cell (including the background), then there's no need to call e.DrawCell at all.

This method uses VisualStyle.System for rendering fixed cells in OwnerDrawCell handler.

See Also

Reference

OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members
Overload List