Once you bind a sheet to a data set you might want to add an unbound column to contain additional data.
The following figure shows a sheet in a Spread component that contains data from a data set and an unbound row at the bottom that calculates the averages.
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 DataField unset for the columns you do not want to bind.
Return to the overall list of tasks in Adding to Bound Data.
- Create your data set.
- Set the FpSpread or Sheet DataSource property equal to the data set.
- Set the ColumnCount property for the sheet.
This example code binds the Spread component to a data set and then sets the column count.
// Bind the component to the data set. fpSpread1.DataSource = dbDataSet; // If this datasource has 19 columns, set the count to 20. fpSpread1.Sheets.ColumnCount=20;
' 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