Spread Windows Forms 6.0 Product Documentation
SetArray Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class : SetArray Method


Glossary Item Box

Sets an object array into a specified range of cells.

Overload List

OverloadDescription
SetArray(Int32,Int32,Object[,])Sets an object array into a specified range of cells.  
SetArray(Int32,Int32,Object[,],Boolean)Sets an object array into a specified range of cells.  

Example

This example sets an object array into a range of cells.
Visual BasicCopy Code
Dim dataModel As New FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 10)
FpSpread1.ActiveSheet.Models.Data = dataModel
Dim arr(5, 10) As Object
Dim o As Object
Dim i, j As Integer
For i = 0 To 4
For j = 0 To 9
arr(i, j) = i + j
Next j
Next i
dataModel.SetArray(1, 0, arr)
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 10);
fpSpread1.ActiveSheet.Models.Data = dataModel;
int i, j;
object[,] arr;
arr = new object[5,10];
for(i = 0; i <= 4; i++)
{
for(j = 0; j <= 9; j++)
arr[i,j] = i + j;
}
dataModel.SetArray(1, 0, arr);
}

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.