Spread ASP.NET 6.0 Product Documentation
Setting a Text Cell
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Editable Cell Types > Setting a Text Cell

Glossary Item Box

You can use text cells to restrict users to entering text values and to display data as text.

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 FpSpread 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.

Return to the overview of editable cell types at Working with Editable Cell Types.

Using Code

  1. Define the text cell type by creating an instance of the TextCellType class.
  2. Set properties for the text cell.
  3. Apply the text cell type to a cell or range of cells.

Example

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

Using the Spread Designer

  1. In the work area, select the cell or cells for which you want to set the cell type.
  2. Select the Home menu.
  3. Select the SetCellType icon under the CellType section.
  4. Select the cell type and any other cell properties.
  5. Select OK to close the dialog.
  6. Click Apply and Exit to close the Spread Designer.
© 2002-2012 GrapeCity, Inc. All Rights Reserved.