GridData.GetRowValues
 
 
 

GridData.GetRowValues operator

Introduced

v4.0

Description

Returns a 1-Dimensional Array containing all the elements in the requested row.

C# Syntax

Object GridData.GetRowValues( Object in_lRow );

Scripting Syntax

oArray = GridData.GetRowValues( RowIndex );

Return Value

1-Dimensional Array

Parameters

Parameter Type Description
RowIndex long or string Index or label of the Row. The top row has index 0.

Examples

JScript Example

//Demo of SetRowValues
//and GetRowValues
var oGridData = XSIFactory.CreateGridData() ;
oGridData.ColumnCount = 2;
oGridData.RowCount = 10;
var aColVals = new Array( 2 ) ;
for( i = 0 ; i < oGridData.RowCount ; i++ )
{
        aColVals[0] = i ;
        aColVals[1] = i + 10 ;
        oGridData.SetRowValues( i, aColVals ) ;
}
//Check the results
for( i = 0 ; i < oGridData.RowCount ; i++ )
{
        // Return value is a SAFEARRAY so we need to convert 
        // to JScript Array to read the values
        var aSafeArray = oGridData.GetRowValues( i ) ;
        var aRead = new VBArray( aSafeArray ).toArray() ;
        if ( aRead[0] != i ||
                aRead[1] != ( i + 10 ) ) {
                LogMessage( "Unexpected"  ) ;
        }
}

See Also

GridData.SetRowValues GridData.GetColumnValues GridData.Data