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 |
Index or label of the Column. The left-most column has index 0. |
|
|
RowIndex |
Index or label of the Row. The top row has index 0. |
|
|
CellValue |
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
SOFTIMAGE|XSI v6.01