Spread for ASP.NET 8.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Editable Cell Types > Setting a Percent Cell |
You can use a percent cell to display percent values. In a percent cell type, a value of 0.35 is displayed as 35%. You can use a percent cell for displaying values as percentages and restricting inputs to percentage numeric values.
The percent cell has a default error message that is displayed if the user types an invalid value and tries to leave the cell.
For details on the properties and methods for this cell type, refer to the PercentCellType class.
This example sets a cell to be a percent cell.
C# |
Copy Code
|
---|---|
FarPoint.Web.Spread.PercentCellType pctcell = new FarPoint.Web.Spread.PercentCellType();
FpSpread1.ActiveSheetView.Cells[1, 1].CellType = pctcell;
|
VB |
Copy Code
|
---|---|
Dim pctcell As New FarPoint.Web.Spread.PercentCellType() FpSpread1.ActiveSheetView.Cells(1, 1).CellType = pctcell |