RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDecisionGrid.OnDecisionDrawCell Event

Occurs just before a cell in the grid is drawn.

Pascal
property OnDecisionDrawCell: TDecisionDrawCellEvent;
C++
__property TDecisionDrawCellEvent OnDecisionDrawCell;

Write an OnDecisionDrawCell event handler to change the color, font, or text used to display an individual cell in the grid. Change the AColor, AFont, or Value parameter to change the color, font, or text respectively. 

For example, to change the row and column labels from the values of the fields in the dataset to customized labels, change the Value parameter of the event handler when the Row and Column parameters represent a label cell. 

The Row and Column parameters indicate the row and column of a cell within the grid, where (0,0) specifies the upper left summary value, not the upper left corner of the grid. Thus, the label cells contain negative row or column indexes. In addition, the AState parameter includes gdFixed when the cell is a label cell. AState also indicates whether the cell being drawn is selected. 

The ADrawState parameter indicates the type of cell that is about to be drawn. ADrawState includes one or more of the following values:

Value 
Meaning 
dsGroupStart  
The cell is the first row or column label for a dimension. Always appears with dsRowValue or dsColValue.  
dsRowCaption  
The cell displays a row caption (the name of a dimension whose values are listed down a column on the left of the grid).  
dsColCaption  
The cell displays a column caption (the name of a dimension whose values are listed along the top of the grid).  
dsSum  
The cell displays a subtotal label or value. Always appears with dsRowValue, dsColValue, or dsData.  
dsRowValue  
The cell is a row label. It represents a value from a dimension listed down a column on the left of the grid or a summary label that appears at the end of each group of dimension values.  
dsColValue  
The cell is a column label. It represents a value from a dimension listed across the top of the grid or a summary label that appears at the end of the dimension.  
dsData  
The cell is in the scrollable data region of the grid.  
dsOpenAfter  
The cell has a plus sign (+) on the right that will open following dimension when clicked. Always appears with dsRowCaption, dsColCaption, dsRowPlus, or dsColPlus.  
dsCloseAfter  
The cell has a minus sign (-) on the right that will close the following dimension when clicked. Always appears with dsRowCaption, dsColCaption, dsRowPlus, or dsColPlus.  
dsRowIndicator  
The cell appears on the left grid margin that is used to display the open and close indicators (+ and -).  
dsColIndicator  
The cell appears on the upper grid margin that is used to display the open and close indicators (+ and -).  
dsRowPlus  
The cell appears in the left margin and contains a plus sign (+) indicating that the adjacent dimension is closed. Always appears with dsRowIndicator.  
dsColPlus  
The cell appears in the top margin and contains a plus sign (+) indicating that the adjacent dimension is closed. Always appears with dsColIndicator.  
dsNone  
The cell has no function.  

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!