Spread for ASP.NET 10 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Editable Cell Types > Setting a Text Cell |
You can use text cells to restrict users to entering text values and to display data as text. You can also specify the maximum text length and a password field.
The following image displays a text cell with a password.
For details on the properties and methods for this cell type, refer to the TextCellType class.
For information about checking a regular expression in a cell, refer to Setting a Regular Expression Cell.
If you anticipate that users need to display text with multiple blank spaces between consecutive words, you should set the AllowWrap property to false; otherwise, the control uses spaces for formatting that Internet Explorer will trim as extra blank spaces (Internet Explorer allows one space in a TD element). If you set the AllowWrap property to false, the control uses the web space character for spaces, and the spaces are not trimmed in the text. |
This example sets a password and a maximum length for the cell.
C# |
Copy Code
|
---|---|
FarPoint.Web.Spread.TextCellType tcell = new FarPoint.Web.Spread.TextCellType(); tcell.Password = true; tcell.MaxLength = 5; FpSpread1.ActiveSheetView.Cells[0, 0].CellType = tcell; |
VB |
Copy Code
|
---|---|
Dim tcell As New FarPoint.Web.Spread.TextCellType() tcell.Password = True tcell.MaxLength = 5 FpSpread1.ActiveSheetView.Cells(0, 0).CellType = tcell |