Spread ASP.NET 17
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / DefaultSheetDataModel Class / SetArray Method
Example


In This Topic
    SetArray Method (DefaultSheetDataModel)
    In This Topic
    Sets an object array into a specified range of cells
    Overload List
    OverloadDescription
    Sets an object array into a specified range of cells.  
    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.
    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
    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);
    }
    See Also