Spread for ASP.NET 8.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Graphical Cell Types > Setting a Label Cell |
A label cell is a cell that cannot be edited by the end user and serves as a label for other cells.
To create a cell that contains a label, follow this procedure.
For details on the properties and methods for this cell type, refer to the LabelCellType class in the Assembly Reference.
This example creates a label cell that displays a currency value.
C# |
Copy Code
|
---|---|
FarPoint.Web.Spread.LabelCellType lblcell = new FarPoint.Web.Spread.LabelCellType(); int i =100; string fstring = i.ToString("C"); lblcell.FormatString = fstring; FpSpread1.ActiveSheetView.Cells[0, 0].CellType = lblcell; FpSpread1.ActiveSheetView.Cells[0, 0].Text = fstring; |
VB |
Copy Code
|
---|---|
Dim lblcell As New FarPoint.Web.Spread.LabelCellType() Dim i As Integer = 100 Dim fstring As String = i.ToString("C") lblcell.FormatString = fstring FpSpread1.ActiveSheetView.Cells(0, 0).CellType = lblcell FpSpread1.ActiveSheetView.Cells(0, 0).Text = fstring |