Spread Windows Forms 13.0 Product Documentation
Spread Windows Forms 13.0 Product Documentation / Developer's Guide / Customizing Sheet Interaction / Customizing Interaction with a Sheet / Creating Tables / Resizing a Table
In This Topic
    Resizing a Table
    In This Topic

    You can resize the table with the resize indicator in the bottom, right corner of the table or you can use code to do so.

    Select the indicator and drag to the right to add columns or down to add rows.

    Using Code

    Use the Resize method to add columns or rows to a table.


    This example code adds rows and columns to the table.

    Copy Code
    FarPoint.Win.Spread.TableStyle tstyle = fpSpread1.CreateTableStyle("Style1", FarPoint.Win.Spread.TableStyle.TableStyleLight2);
    fpSpread1.Sheets[0].Cells[1, 1].Text = "Last Name";
    fpSpread1.Sheets[0].Cells[1, 2].Text = "Value";
    fpSpread1.Sheets[0].Cells[2, 1].Text = "Smith";
    fpSpread1.Sheets[0].Cells[2, 2].Value = 50;
    fpSpread1.Sheets[0].Cells[3, 1].Text = "Vil";
    fpSpread1.Sheets[0].Cells[3, 2].Value = 10;
    fpSpread1.Sheets[0].Cells[4, 1].Text = "Press";
    fpSpread1.Sheets[0].Cells[4, 2].Value = 78;
    FarPoint.Win.Spread.TableView table = fpSpread1.Sheets[0].AddTable("table", 1, 1, 5, 2, "Style1");
    table.Resize(6, 3);
    Copy Code
    Dim tstyle As FarPoint.Win.Spread.TableStyle
    tstyle = fpSpread1.CreateTableStyle("Style1", FarPoint.Win.Spread.TableStyle.TableStyleLight2)
    fpSpread1.Sheets(0).Cells(1, 1).Text = "Last Name"
    fpSpread1.Sheets(0).Cells(1, 2).Text = "Value"
    fpSpread1.Sheets(0).Cells(2, 1).Text = "Smith"
    fpSpread1.Sheets(0).Cells(2, 2).Value = 50
    fpSpread1.Sheets(0).Cells(3, 1).Text = "Vil"
    fpSpread1.Sheets(0).Cells(3, 2).Value = 10
    fpSpread1.Sheets(0).Cells(4, 1).Text = "Press"
    fpSpread1.Sheets(0).Cells(4, 2).Value = 78
    Dim table As FarPoint.Win.Spread.TableView = fpSpread1.Sheets(0).AddTable("table", 1, 1, 5, 2, "Style1")
    table.Resize(6, 3)
    See Also