Spread for ASP.NET 7.0 Product Documentation
SetArray Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.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.  

Remarks

Sets an object array into a specified range of cells

Example

This example creates a new DefaultSheetDataModel and attaches it to the DataModel of the active sheet. Data is added via the SetArray method.
Visual BasicCopy Code
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load

If(Me.IsPostBack)Then Return

Dim dm As New FarPoint.Web.Spread.Model.DefaultSheetDataModel(8,8)
FpSpread1.ActiveSheetView.DataModel=dm

Dim arr(4,9) 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
dm.SetArray(1,0,arr)
End Sub
C#Copy Code
private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;

FarPoint.Web.Spread.Model.DefaultSheetDataModel dm=new FarPoint.Web.Spread.Model.DefaultSheetDataModel(10,10);
FpSpread1.ActiveSheetView.DataModel=dm;

int i,j;
object[,]arr;
arr=new object[4,9];
for(i=0;i<4;i++)
{
for(j=0;j<9;j++)
arr[i,j]=i+j;
}
dm.SetArray(1,0,arr);
}

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

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