GridData.SetCellReadOnlyFlags

Introduced

v12.0 (2014)

Description

Changes the given cells read-only flag.

C# Syntax

GridData.SetCellReadOnlyFlags( Object in_vCells, Boolean in_bLock );

Scripting Syntax

GridData.SetCellReadOnlyFlags( Cells, ReadOnly );

Parameters

Parameter Type Description
Cells Array of Long Array containing the column/row pairs representing the cells for which to change the read-only flag.
ReadOnly Boolean Read-only flag for the given cells. If True, cells are read-only.

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 ) )

# Set the diagonal as read-only

ROcells = [ 0,0, 1,1, 2,2 ]

gridData.SetCellReadOnlyFlags( ROcells, True ) 

Application.InspectObj( siProperty )

See Also

GridData.GetCellReadOnlyFlags