Spread Silverlight Documentation
AddTable(String,Int32,Int32,Object) Method
Example 


The table name.
The row index.
The column index.
The data source for the table.
Adds a range table with a specified data source to the sheet.
Syntax
'Declaration
 
Public Overloads Function AddTable( _
   ByVal tableName As System.String, _
   ByVal row As System.Integer, _
   ByVal column As System.Integer, _
   ByVal datasource As System.Object _
) As SheetTable
'Usage
 
Dim instance As Worksheet
Dim tableName As System.String
Dim row As System.Integer
Dim column As System.Integer
Dim datasource As System.Object
Dim value As SheetTable
 
value = instance.AddTable(tableName, row, column, datasource)
public SheetTable AddTable( 
   System.string tableName,
   System.int row,
   System.int column,
   System.object datasource
)

Parameters

tableName
The table name.
row
The row index.
column
The column index.
datasource
The data source for the table.

Return Value

The new table instance.
Example
This example uses the AddTable method.
public class lname
        {
            public string last { get; set; }
            public int val { get; set; }
            public lname(string last, int val)
            {
                this.last = last;
                this.val = val;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            lname[] arr = new lname[] { new lname("Smith", 100), new lname("Fender", 3), new lname("Gill", 5) };
            gcSpreadSheet1.Sheets[0].AddTable("Table1", 0, 0, arr);
            gcSpreadSheet1.Invalidate();
Public Class lname
    Public Property last() As String
        Get
            Return m_last
        End Get
        Set
            m_last = Value
        End Set
    End Property
    Private m_last As String
    Public Property val() As Integer
        Get
            Return m_val
        End Get
        Set
            m_val = Value
        End Set
    End Property
    Private m_val As Integer
    Public Sub New(last As String, val As Integer)
        Me.last = last
        Me.val = val
    End Sub
End Class

Dim arr As lname() = New lname() {New lname("Smith", 100), New lname("Fender", 3), New lname("Gill", 5)}
GcSpreadSheet1.Sheets(0).AddTable("Table1", 0, 0, arr)
GcSpreadSheet1.Invalidate()
Requirements

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

See Also

Reference

Worksheet Class
Worksheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.