Spread Windows Forms 13.0 Product Documentation
Spread Windows Forms 13.0 Product Documentation / Developer's Guide / Managing Data Binding / Adding to Bound Data / Adding an Unbound Column to a Bound Sheet
In This Topic
    Adding an Unbound Column to a Bound Sheet
    In This Topic

    Once you bind a sheet to a data set you might want to add an unbound column to contain additional data.

    You can add an unbound column to the Spread control by increasing the ColumnCount property after the control is bound. Another option is to use the DataField property to bind specific columns and leave the DataField property unset for the columns you do not want to bind.

    Using Code

    1. Create your data set.
    2. Set the FpSpread object's or Sheet object's DataSource property equal to the data set.
    3. Set the ColumnCount property for the sheet.

    Example

    This example code binds the Spread component to a data set and then sets the column count.

    C#
    Copy Code
    // Bind the component to the data set.
    fpSpread1.DataSource = dbDataSet;
    // If this datasource has 19 columns, set the count to 20.
    fpSpread1.Sheets[0].ColumnCount=20;
    VB
    Copy Code
    ' Bind the component to the data set.
    fpSpread1.DataSource = dbDataSet
    ' If this datasource has 19 columns, set the count to 20.
    fpSpread1.Sheets(0).ColumnCount=20
    See Also