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


row
Row index of first cell in range
column
Column index of first cell in range
rowCount
Number of rows in range
columnCount
Number of columns in range

Glossary Item Box

Gets a two-dimensional array of objects containing the data for the specified range of cells on the sheet.

Syntax

Visual Basic (Declaration) 
Public Function GetArray( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As Object(,)
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim value() As Object
 
value = instance.GetArray(row, column, rowCount, columnCount)
C# 
public object[,] GetArray( 
   int row,
   int column,
   int rowCount,
   int columnCount
)

Parameters

row
Row index of first cell in range
column
Column index of first cell in range
rowCount
Number of rows in range
columnCount
Number of columns in range

Return Value

Object array containing the data for the specified range of cells

Remarks

This method returns a two-dimensional array (row,column).

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 an empty array of objects is returned.

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.

Example

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.
C#Copy Code
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();
Visual BasicCopy Code
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()

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.