GridData.GetCellBackgroundColor
 
 
 

GridData.GetCellBackgroundColor

Introduced

v12.0 (2014)

Description

Gets the specified cell's background color.

C# Syntax

Color GridData.GetCellBackgroundColor( Int32 in_lCol, Int32 in_lRow );

Scripting Syntax

oReturn = GridData.GetCellBackgroundColor( Column, Row );

Return Value

Color used to draw the specified cell's background.

Parameters

Parameter Type Description
Column Long Column index of the cell.
Row Long Row index of the cell.

Examples

Python Example

import win32com.client
from win32com.client import constants as C
propName = "TheProperty"
gridDataName = "TheGrid"
siProperty = Application.ActiveSceneRoot.AddProperty( "CustomProperty", False, propName ) 
gridData = siProperty.AddGridParameter(gridDataName).Value 
gridData.ColumnCount = 3
gridData.RowCount = 3
for row in range( 3 ):
        gridData.SetRowLabel( row, "Row %d"%row )
        for col in range ( 3 ):
                if row == 1:
                        gridData.SetColumnLabel( col, "Col %d"%col )
                gridData.SetCell( col, row, "%d,%d"%( col, row ) )
Application.InspectObj( siProperty )
# Set third row background color to Blue
color = gridData.GetCellBackgroundColor( 0, 2 )
color.Red = 0
color.Green = 0
color.Blue = 255
for col in range(3):
        gridData.SetCellBackgroundColor( col, 2, color )
# Log the first column cell colors
for row in range(3):
        color = gridData.GetCellBackgroundColor( 0, row )
        Application.LogMessage("Color for (%d,%d) = (%d, %d, %d)"%( 0, row, color.Red, color.Green, color.Blue ) )

See Also

GridData.SetCellBackgroundColor