Skip to main content

Custom Painting Overview

  • 2 minutes to read

The ExpressVerticalGrid provides two general ways to customize the appearance of its elements. The first way is to change the styles of its elements. Please refer to the Styles Overview and Using Styles Events topics for information on the style technology capabilities. Generally, styles are everything you need to give the desired look to your vertical grid control. However, there can be situations when you need greater control over the appearance and contents of elements. In this case, you should paint the elements manually. This topic explains the basics of how to do this.

Custom Painting Basics

You can paint vertical grid elements manually by handling specially designed events of the vertical grid control.

Event Description
OnDrawBackground Occurs before painting the vertical grid’s background.
OnDrawRowHeader Occurs before painting row headers.
OnDrawValue Occurs before painting row values.

Thus, you can provide a custom appearance for all element types in all their states.

Custom painting events have different parameter sets since they are designed to paint different elements. However, some of the parameters are common for all events, as listed below:

Parameter Description
ACanvas Represents a TCanvas instance, defining the graphic surface of the painted element. This object provides various properties and methods for painting the desired grid element.
APainter Specifies a TcxvgPainter instance – a painter that provides various methods for painting vertical grid elements.
Done A Boolean parameter that specifies whether default painting is required. Setting it to False enables default painting, setting it to True disables it.