Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / SheetView Class / SetArray Method
Row index
Column index
Array from which to set values

In This Topic
    SetArray Method (SheetView)
    In This Topic
    Sets the values in the specified two-dimensional array of objects into the specified range of cells on this sheet.
    Public Sub SetArray( _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal value(,) As Object _
    Dim instance As SheetView
    Dim row As Integer
    Dim column As Integer
    Dim value() As Object
    instance.SetArray(row, column, value)
    public void SetArray( 
       int row,
       int column,
       object[,] value


    Row index
    Column index
    Array from which to set values

    This method is dependent on the data model for the sheet (Models.Data) implementing the IArraySupport interface. If this interface is not implemented on the selection model, then this method does nothing.

    Besides using this method, you can get or set the value in a cell using various properties of the sheet (SheetView object) or properties of the cell (Cell object). For more information, see Handling Data Using Sheet Methods and Handling Data Using Cell Properties.

    Remember that the data may be displayed differently in a cell depending on the cell type. For more information, see Understanding Cell Type Effects on Displaying Data.

    This example illustrates the use of this member by returning a two-dimensional array of objects containing the data for the specified range of cells.
    object[,] arr;
    fpSpread1.ActiveSheet.SetArray(1, 0, new String[,] {{"One", "Two"}});
    fpSpread1.ActiveSheet.SetArray(2, 1, new String[,] {{"Three", "Four"}});
    arr = fpSpread1.ActiveSheet.GetArray(1, 0, 3, 2);
    label1.Text = "The value of the first element in the array is " + arr.GetValue(0, 0).ToString();
    Dim arr(,) As Object
    FpSpread1.ActiveSheet.SetArray(1, 0, New String(,) {{"One", "Two"}})
    FpSpread1.ActiveSheet.SetArray(2, 1, New String(,) {{"Three", "Four"}})
    arr = FpSpread1.ActiveSheet.GetArray(1, 0, 3, 2)
    Label1.Text = "The value of the first element in the array is " & arr.GetValue(0, 0).ToString()
    See Also