SetCell (GridData) *

Introduced

4.0

Description

Changes the value of a single element inside the GridData object. The coordinates must be within the valid range of the GridData's dimensions.

When the rows and columns have label strings it is possible to specify the labels rather than indices. This is a slightly slower approach but it makes the code easier to read.

Scripting Syntax

    GridData.SetCell( ColumnIndex, RowIndex, [CellValue] )

C# Syntax

    GridData.SetCell( Object in_Column, Object in_Row, Object in_CellValue );

Parameters

Parameter | Type | Description
ColumnIndex | Long or String | Index or label of the Column. The left-most column has index 0.
RowIndex | Long or String | Index or label of the Row. The top row has index 0.
CellValue | Variant | New value for the cell

Examples

JScript Example

    //Demonstrate setting data with the GridData.Data method
    var oGridData = XSIFactory.CreateGridData();

    oGridData.RowCount = 1 ;
    oGridData.ColumnCount = 4 ;

    oGridData.SetCell( 0, 0, "Column0,Row0" ) ;
    oGridData.SetCell( 1, 0, "Column1,Row0" ) ;

    try
    {
       oGridData.SetCell( 9, 10, "Invalid Coordinates" ) ;
    }
    catch( e )
    {
       Logmessage( "Invalid range specified" ) ;
    }

See Also

GridData.GetCell | GridData.Data

Autodesk Softimage v7.5