GrapeCity.Xaml.SpreadSheet.Data
AddTable(String,Int32,Int32,Int32,Int32) Method
Example 


GrapeCity.Xaml.SpreadSheet.Data Namespace > Worksheet Class > AddTable Method : AddTable(String,Int32,Int32,Int32,Int32) Method
The table name.
The row index.
The column index.
The row count of the table.
The column count of the table.
Adds a range table with a specified size to the sheet.
Syntax
'Declaration
 
Public Overloads Function AddTable( _
   ByVal tableName As String, _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As SheetTable
'Usage
 
Dim instance As Worksheet
Dim tableName As String
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim value As SheetTable
 
value = instance.AddTable(tableName, row, column, rowCount, columnCount)
public SheetTable AddTable( 
   string tableName,
   int row,
   int column,
   int rowCount,
   int columnCount
)

Parameters

tableName
The table name.
row
The row index.
column
The column index.
rowCount
The row count of the table.
columnCount
The column count of the table.

Return Value

The new table instance.
Example
This example creates a table.
private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            gcSpreadSheet1.Sheets[0].Cells[1, 1].Text = "Last Name";
            gcSpreadSheet1.Sheets[0].Cells[1, 2].Text = "Value";
            gcSpreadSheet1.Sheets[0].Cells[2, 1].Text = "Smith";
            gcSpreadSheet1.Sheets[0].Cells[2, 2].Value = 50;
            gcSpreadSheet1.Sheets[0].Cells[3, 1].Text = "Vil";
            gcSpreadSheet1.Sheets[0].Cells[3, 2].Value = 10;
            gcSpreadSheet1.Sheets[0].Cells[4, 1].Text = "Press";
            gcSpreadSheet1.Sheets[0].Cells[4, 2].Value = 78;
            gcSpreadSheet1.Sheets[0].AddTable("Table1", 1, 1, 5, 2);             
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].FindTable(1, 1).Name.ToString());
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].FindTable("Table1").ShowHeader.ToString());
            //gcSpreadSheet1.Sheets[0].RemoveTable("Table1");
            //gcSpreadSheet1.Sheets[0].MoveTable("Table1", 3, 2);
            //gcSpreadSheet1.Sheets[0].ResizeTable("Table1", 6, 3);     
        }
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        GcSpreadSheet1.Sheets(0).Cells(1, 1).Text = "Last Name"
        GcSpreadSheet1.Sheets(0).Cells(1, 2).Text = "Value"
        GcSpreadSheet1.Sheets(0).Cells(2, 1).Text = "Smith"
        GcSpreadSheet1.Sheets(0).Cells(2, 2).Value = 50
        GcSpreadSheet1.Sheets(0).Cells(3, 1).Text = "Vil"
        GcSpreadSheet1.Sheets(0).Cells(3, 2).Value = 10
        GcSpreadSheet1.Sheets(0).Cells(4, 1).Text = "Press"
        GcSpreadSheet1.Sheets(0).Cells(4, 2).Value = 78
        GcSpreadSheet1.Sheets(0).AddTable("Table1", 1, 1, 5, 2)
    End Sub

Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
        ListBox1.Items.Add(GcSpreadSheet1.Sheets(0).FindTable(1, 1).Name.ToString())
        ListBox1.Items.Add(GcSpreadSheet1.Sheets(0).FindTable("Table1").ShowHeader.ToString())
        'GcSpreadSheet1.Sheets(0).RemoveTable("Table1")
        'GcSpreadSheet1.Sheets(0).MoveTable("Table1", 3, 2)
        'GcSpreadSheet1.Sheets(0).ResizeTable("Table1", 6, 3)        
    End Sub
See Also

Reference

Worksheet Class
Worksheet Members
Overload List