Spread ASP.NET 6.0 Product Documentation
SetArray Method
See Also  Example Send Feedback
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
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(Me.IsPostBack)ThenReturn

DimdmAsNewFarPoint.Web.Spread.Model.DefaultSheetDataModel(8,8)
FpSpread1.ActiveSheetView.DataModel=dm

Dimarr(4,9)AsObject
DimoAsObject
Dimi,jAsInteger
Fori=0To4
Forj=0To9
arr(i,j)=i+j
Nextj
Nexti
dm.SetArray(1,0,arr)

EndSub
C#Copy Code
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;

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

inti,j;
object[,]arr;
arr=newobject[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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.