Spread Windows Forms 11.0 Product Documentation
Step 4: Improving the Display by Changing the Cell Type
Spread Windows Forms 11.0 Product Documentation > Developer's Guide > Managing Data Binding > Tutorial: Binding to a Corporate Database (Visual Studio 2013 or later) > Step 4: Improving the Display by Changing the Cell Type

Using Code

In this step, you will change the cell type for one of the columns to better display the data from the database.

  1. Double-click on the form to open the code window.
  2. Set the cell type for the UnitPrice column by adding the code in the boxes below the code that Visual Studio has placed in the Form_Load event.
  3. Save your project.

Example

C#
Copy Code
FarPoint.Win.Spread.CellType.CurrencyCellType CurrCell = new FarPoint.Win.Spread.CellType.CurrencyCellType();
CurrCell.DecimalPlaces = 2;
CurrCell.CurrencySymbol = "US$";
fpSpread1.Sheets[0].Columns[3].CellType = CurrCell;
VB
Copy Code
Dim CurrCell As New FarPoint.Win.Spread.CellType.CurrencyCellType()
CurrCell.DecimalPlaces = 2
CurrCell.CurrencySymbol = "US$"
fpSpread1.Sheets(0).Columns(3).CellType = CurrCell

Run your project and you should see a form that looks similar to the following:

You have managed data binding to a corporate database using Spread. You have completed this tutorial.

Review the list of steps for Tutorial: Binding to a Corporate Database (Older Visual Studio).