Skip to main content
A newer version of this page is available. .

VGridControlBase.CustomDrawRowHeaderCell Event

Enables row header cells to be painted manually.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v18.2.dll

Declaration

public event CustomDrawRowHeaderCellEventHandler CustomDrawRowHeaderCell

Event Data

The CustomDrawRowHeaderCell event's data class is CustomDrawRowHeaderCellEventArgs. The following properties provide information specific to this event:

Property Description
AllowGlyphSkinning Gets or sets whether this row header cell’s icon can be painted with a foreground color.
AllowHtmlText Gets or sets whether the row caption is formatted using HTML tags.
Appearance Gets the painted element’s appearance settings. Inherited from CustomDrawEventArgs.
Bounds Gets a value specifying limits for the drawing area. Inherited from CustomDrawEventArgs.
Cache Gets an object which specifies the storage for the most used pens, fonts and brushes. Inherited from CustomDrawEventArgs.
Caption Gets or sets the text displayed within the painted row header cell.
CaptionRect Gets the bounding rectangle of the row header cell’s caption.
CellIndex Gets the index of the painted row header cell.
Focused Gets a value indicating whether the painted row header cell has focus.
FocusRect Gets the bounds of the focus rectangle around the row header cell.
Graphics Gets an object used to paint. Inherited from CustomDrawEventArgs.
Handled Gets or sets a value specifying whether an event was handled, if handled, default actions are not required. Inherited from CustomDrawEventArgs.
HotTrack Gets a value indicating whether the mouse pointer passes over the painted row header cell.
ImageIndex Gets or sets the image displayed within the painted row header cell.
ImageRect Gets the bounding rectangle within the painted row header cell where the image is to be drawn.
IsRightToLeft Gets a value indicating whether the VGridControl‘s elements are aligned to support locales using right-to-left fonts. Inherited from CustomDrawEventArgs.
ObjectArgs Gets an object containing information about the painted element. Inherited from CustomDrawEventArgs.
Painter Gets the painter object that provides the default element’s painting mechanism. Inherited from CustomDrawEventArgs.
Pressed Gets a value indicating whether the painted row header cell is pressed.
Properties Provides properties specific to the row being custom painted. Inherited from CustomDrawRowEventArgs.
Row Gets the row whose element is to be drawn. Inherited from CustomDrawRowEventArgs.
Selected Gets whether or not the current row is selected.

The event data class exposes the following methods:

Method Description
DefaultDraw() Performs default painting of an element. Inherited from CustomDrawEventArgs.

Remarks

The CustomDrawRowHeaderCell event is raised before a row header cell is painted. The cell that is going to be painted is identified by the event parameter’s CustomDrawRowHeaderCellEventArgs.CellIndex property. The row where the processed cell resides can be obtained via the CustomDrawRowEventArgs.Row property.

The CustomDrawRowHeaderCell event can be used for two purposes:

  • To manually paint all or only particular row header cells. The event parameter allows you to obtain the processed cell’s caption, state, whether it has focus, etc. Note that you need to set the CustomDrawEventArgs.Handled parameter to true to indicate that the default painting is not required for the cell.
  • Change the cell’s settings (image, style settings etc) and leave the CustomDrawEventArgs.Handled parameter set to false. This will paint the row header cell using the default mechanism but with modified settings.

Important

Never change cell values or modify the control’s layout on this event, or any other event designed to tune the control’s appearance. Any action that causes a layout update can cause the control to malfunction.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CustomDrawRowHeaderCell event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also