Skip to content

ForeColor Property

Description

The color of the text / caption of a GridRecordItem.

Property Type

Read-write property

Syntax (Visual Basic)

Public Property ForeColor() As ULong

Remarks

This property will contain a reference to the ForeColor of a GridRecordItem when the BeforeDrawRow event is executed. You can then edit the color, and it will modify the ForeColor of the GridRecordItem. The ForeColor is the color of the text / caption.

Example

Modifying the Text Color of a GridRecordItem (Visual Basic)

This sample illustrates how to modify the text color of a GridRecordItem using the GridRecordItemMetrics object in the BeforeDrawRow event.

' This event is called for each GridRecordItem in each GridRow before it is drawn  
Private Sub wndGridControl_BeforeDrawRow(ByVal Row As XtremeGridControl.IGridRow, _  
                                           ByVal Item As XtremeGridControl.IGridRecordItem, _  
                                           ByVal Metrics As XtremeGridControl.IGridRecordItemMetrics)  

    ' This block of code is only executed if the index of the GridRow the GridRecordItem is on is  
    ' an even number. This will cause the code to be executed for every other row. So the ForeColor  
    ' of all GridRecordItems in a GridRow will be modified.  
    If (Row.Index Mod 2 = 0) Then  
        ' This will change the ForeColor (text color) of the GridRecordItem to red  
        Metrics.ForeColor = vbRed  
    End If  
End Sub  

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.