In this step, you will change the cell type for one of the columns to better display the data from the database.
- Double-click on the form to open the code window.
- Set the cell type for the UnitPrice column by adding the following code below the code you have already added:
C# Copy Code FarPoint.Web.Spread.StyleInfo style = new FarPoint.Web.Spread.StyleInfo(); FarPoint.Web.Spread.CurrencyCellType curPrice = new FarPoint.Web.Spread.CurrencyCellType(); curPrice.FixedPoint = true; style.CellType = curPrice; style.HorizontalAlign = HorizontalAlign.Right; style.VerticalAlign = VerticalAlign.Middle; FpSpread1.ActiveSheetView.SetStyleInfo(-1, 3, style);
Visual Basic Copy Code Dim style As FarPoint.Web.Spread.StyleInfo style = New FarPoint.Web.Spread.StyleInfo() Dim curPrice As New FarPoint.Web.Spread.CurrencyCellType() curPrice.FixedPoint = True style.CellType = curPrice style.HorizontalAlign = HorizontalAlign.Right style.VerticalAlign = VerticalAlign.Middle FpSpread1.ActiveSheetView.SetStyleInfo(-1, 3, style)
- Save your project.
Run your project and you should see a form that looks similar to the following:
Your bound Spread component is complete! You have completed this tutorial.
Return to the overview of the Tutorial: Binding to a Corporate Database tutorial.