Spread for ASP.NET 8.0 Product Documentation
ValidationExpression Property (RegExpCellType)
Example 


Gets or sets the regular expression used to validate the value in the cell.
Syntax
'Declaration
 
Public Property ValidationExpression As String
'Usage
 
Dim instance As RegExpCellType
Dim value As String
 
instance.ValidationExpression = value
 
value = instance.ValidationExpression
public string ValidationExpression {get; set;}

Property Value

String containing the regular expression
Example
This example creates a regular expression cell type (RegExpCellType object) and assigns it to the first cell in the sheet. Its ErrorMessage has been added in the constuctor. The ValidationExpression property has also been set. So if the user enters data that does not conform to the regular expression, a warning appears.
FarPoint.Web.Spread.RegExpCellType re = new FarPoint.Web.Spread.RegExpCellType();
re.ErrorMessage = "SSN ( ex, 123-45-6789 )";
re.ValidationExpression = "^\\d{3}-\\d{2}-\\d{4}$";
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = re;
Dim re As New FarPoint.Web.Spread.RegExpCellType()
re.ErrorMessage = "SSN ( ex, 123-45-6789 )"
re.ValidationExpression = "^\d{3}-\d{2}-\d{4}$"
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = re
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

RegExpCellType Class
RegExpCellType Members
ErrorMessage Property

 

 


Copyright © GrapeCity, inc. All rights reserved.