Programmieren mit dBASE PLUS: Events: beforeCellPaint
An event fired just before a grid cell is painted.
bSelectedRow is true if the grid cell being painted is part of a selected row. Otherwise bSelectedRow is false
Use the beforeCellPaint event to change the settings of a GridColumn's editorControl or headingControl just before the control is used to paint a grid cell.
After the grid cell has been painted, the onCellPaint event will fire. You must use the onCellPaint event to set the control back to it's prior, or it's default, state. Otherwise, the changes made in the beforeCellPaint event will affect the other cell's within the same grid column.
In order to use beforeCellPaint, a grid must be created with explicitly defined GridColumn objects (accessible through the grid's columns property).
In a beforeCellPaint event handler, you can change an editorControl's or headingControl's properties based (optionally) on the current value of the cell. Within beforeCellPaint, the current cell value is contained in this.value.
Initializing a Grid that uses beforeCellPaint
When a form opens, a grid on the form is usually painted before the code setting up any beforeCellPaint event handlers is executed. Therefore, you should call the grid's refresh( ) method from the form's onOpen event to ensure the grid is painted correctly when the form opens.
Warning: The grid's painting logic is optimized to only load an editorControl's value when it needs to paint it, or give it focus. This means the value loaded into other column's editorControls may not be from the same row as the one used for the currently executing beforeCellPaint event. You should instead, therefore, use the values from the appropriate rowset field objects in order to ensure you are using values from the correct row.