v4.0
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.
GridData.SetCell( ColumnIndex, RowIndex, [CellValue] ); |
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 |
//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" ) ; } |